September 2001
Intermediate to advanced
768 pages
32h 45m
English
string implode(string glue, array pieces)
Creates a string from array elements.
Returns:
String
Description:
implode() creates a string from an array’s values. The string consists of each value in the pieces array, with the string specified in the glue argument placed between pieces. The values occur in the string in the same order as in the array.
Version:
PHP 3+, PHP 4+
See also:
To split a string into an array of substrings:
explode() split() join()
Example:
<?php $pieces = array ('piece one', 'piece two', 'piece three' ); $glue = '[glue]'; echo "The structure of the \$pieces array is:\n"; var_dump ($pieces); echo "\nCalling \"echo implode ('$glue', \$pieces);\" outputs:\n"; echo implode ($glue, ... |
Read now
Unlock full access