implode   PHP


Summary

Join array elements with a string


implode ( string $glue , array $pieces ) : string
implode ( array $pieces ) : string

Join array elements with a glue string.

<?php

$array = array('a', 'b', 'c');
$comma_separated = implode(", ", $array);

echo $comma_separated;
?>


Result

a, b, c

References


Tags

#array  #explode  #implode  #join  #split  #stringtokenizer 


[ Edit (Author only) ]