Pages

PHP implode Function

The implode function in PHP is used to join array elements with a specified delimiter. It is the opposite of the explode function.
The syntax of the implode function is:
implode ('delimiter', $array)
delimiter is the string (can be one or more characters) used as a separator in the resulting string.
Let's take a look at the examples below:
Example 1
$array1 = array('one','two','three');
print (implode ('+',$array1));
Result:
one+two+three
Example 2
$array2 = array('alpha','beta','delta');
print (implode (' plus ',$array2));
Result:
alpha plus beta plus delta

If you like this please Link Back to this article...



0 comments:

Post a Comment