Definition
The join() function returns a string from the elements of an array. This function is an alias of the implode()
function.
Syntax
join(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 join(" ",$welcome);