join() function php

The join() function returns a string from the elements of an array.
 
The join() function is an alias of the implode() function.

<?php

$gallery = array(1,2,35,9);
var_dump($gallery);

$gallery2 = join(',',$gallery);

var_dump($gallery2);

?>

Output

array
  0 => int 1
  1 => int 2
  2 => int 35
  3 => int 9

string '1,2,35,9' (length=8)