php convert array to formatted string code example
Example 1: php Array to string conversion
Using implode() function in Php
-----------------------
Syntax
implode(separator,array);
Example
<?php
$dummyArr = array("Hello","Greppers,","Ankur","here !");
echo implode(" ",$dummyArr);
?>
Output:
Hello Greppers, Ankur here !
Example 2: Notice: Array to string conversion php
// Joining all the cells in the array together:
<?php
$stuff = array(1,2,3);
print implode(", ", $stuff);
print join(',', $stuff);
?>