1//join string values by comma in loop
2$string = '';
3
4foreach ($array as $key => $value) {
5 $string .= ",$value";
6}
7
8$string = substr($string, 1); // remove leading ","
9//@sujay
1$values = "";
2
3foreach ($stuffs as $stuff) {
4 $values != "" && $values .= ",";
5 $values .= $stuff;
6 }
7
8echo $values;
9//@sujay