PHP implode() Function

Last Updated:

PHP implode()

The implode() function joins array elements with a string.

Note: This function accept its parameters in either order. For consistency with explode(), however, it is deprecated not to use the documented order of arguments.

Note: This function is binary-safe.


PHP Compiler
<?php $arr = array('apple', 'banana', 'orange'); echo implode("s, ", $arr); ?>


implode(str, arr)

Parameter Values

str Optional Specifies a string to prepend to each element in an array.
Default value is an empty string.
arr Required Specifies an array.

Return Value

String Returns a string containing a string representation of all the array elements in the same order, with the glue string between each element.

Share this Page

Meet the Author