I suspect it is because you are echoing the data to the browser and it's not showing the line break as you expect. If you wrap your implode in the the <pre>
tags, you can see it is working properly.
Additionally, your arguments are backwards on your implode function, according to current documentation. However, for historical reasons, parameters can be in either order.
$array = array('this','is','an','array');
echo "<pre>".implode(",\n",$array)."</pre>";
Output:
this,
is,
an,
array