PHP implode() Function

PHP implode() Function

The implode() function in PHP joins the specified array elements with a string.

Syntax

Parameter

glue(optional)- It specifies what to put between the array elements.

pieces(required)- This parameter represents the array of strings to implode.

Return

This function returns a string containing a string representation of all the array elements in the same order, with the glue string between each element.

Example 1

Output

Example 2

Output

Example 3

Output