Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
How To Join Multiple Strings Stored in an Array into a Single String
How To Join Multiple Strings Stored in an Array into a Single String? - PHP Script Tips - PHP Built-in Functions for Arrays
✍: FYIcenter.com
If you multiple strings stored in an array, you can join them together into a single string with a given delimiter by using the implode() function. Here is a PHP script on how to use implode():
<?php $date = array('01', '01', '2006'); $keys = array('php', 'string', 'function'); print("A formated date: ".implode("/",$date)."\n"); print("A keyword list: ".implode(", ",$keys)."\n"); ?>
This script will print:
A formated date: 01/01/2006 A keyword list: php, string, function
2007-04-21, 5188👍, 0💬
Popular Posts:
How can method defined in multiple base classes with same name be invoked from derived class simulta...
How to create arrays in JavaScript? We can declare an array like this var scripts = new Array(); We ...
What’s the difference between Unit testing, Assembly testing and Regression testing? Unit testing is...
If we have the following in a Java code: String s="abc"; String s2="abc"; Then what will be output o...
How To View All Columns in an Existing Table? - Oracle DBA FAQ - Managing Oracle Database Tables If ...