Definition
The implode() function returns a string from the elements of an array.
Syntax
implode(separator, array)
Parameters
Parameter | Description |
---|---|
separator |
Optional. Specifies what to put between the array elements. Default is "" (an empty string). |
array |
Required. The array to join to a string. |
Example
<?php
$welcome = array('Welcome', 'to', 'PHP', 'Tutorials!');
echo implode(" ", $welcome);