I have a smiliar loop:
$names = "
[$name , $surname]
";
echo "$names";
The result:
[Mario,Rossi]
[Aberto,rossi]
[Giovanni,Rossi]
i would this output:
[Mario,Rossi],
[Aberto,rossi],
[Giovanni,Rossi]
Without , in the last result
* I can't know the number of results in the loop