Heres what i mean:
foreach ($array as $a) { echo $a.',<br/>'; }
current output would be:
a, a, a, a,
i want the output to be like this:
a, a, a, a
(all ‘a’ separated with comma and when it comes to the last loop it doesnt write a comma)
Advertisement
Answer
Try this:
echo implode(",<br/>", $array);