array string php code example
Example 1: implode php
$array = array('banana', 'strawberry', 'apple');
comma_separated = implode(",", $array);
echo comma_separated; // banana,strawberry,apple
Example 2: php implode
$colors = array("red","blue","green");
$colorsCSV= "'".implode("','",$colors)."'";
//$colorsCSV: 'red','blue','green'
Example 3: arry to string php
implode("|",$type);