PHP: Convert an array into string

You can convert a array into a string using implode() function. This function takes the joining delimiter for the array, and the array itself, and return the string.

$array = array(1,2,3,4,5,6,7);
$string = implode('', $array);
print "$string\n


You can change this into any delimiter. I mean you can pass any string, for example tab, comma, dot as glue/delimiter inside implode() function

Comments