Display array values in PHP
You can use implode to return your array with a string separator.
$withComma = implode(",", $array);echo $withComma;// Will display apple,banana,orange
<?php $data = array('a'=>'apple','b'=>'banana','c'=>'orange');?><pre><?php print_r($data); ?></pre>
Result:
Array
(
[a] => apple
[b] => banana
[c] => orange
)