I have a foreach loop that goes through a list of arrays. For each array it adds a string, e.g. a comma.
Now, what I want is: when the last array is echoed: no string (comma).
foreach($array as $value) {
echo $value;
if(!end($array)) {echo ",";} // Doesn't seem to work
}
Any ideas?