echo array with seperator php code example
Example 1: php implode
$colors = array("red","blue","green");
$colorsCSV= "'".implode("','",$colors)."'";
//$colorsCSV: 'red','blue','green'
Example 2: php implode
$arr = ['Thor','Captain America','Iron Man'];
echo implode(', ',$arr);
// "Thor, Captain America, Iron Man"