implode
Joins array elements with a string separator.
Parameters
main.php
Return Values
string
Returns a string containing all array elements joined by separator
On success:String with array values joined by separator
On failure:Empty string if array is empty
Notes
- For historical reasons, parameters can be in either order
- If separator is omitted, empty string is used as default
- Function works with array values, ignoring keys
- Objects in array must implement __toString() method
Changelog
- 7.4.0: Passing separator after array is deprecated
- 8.0.0: Passing separator after array throws TypeError
Related Functions
array_merge
ArrayMerges the elements of one or more arrays together so that the values of one are appended to the end of the previous one.
mergecombinejoin