<table>
<tr>
<th>Products</th>
</tr>
<td>
<?
foreach ($invoice->cart->items as $id => $item) {
?>
<?=$item->getName()?>
<?
}
?>
</td>
</table>
If I have 4 Products then I want to separate with coma ?
For example if I have 4 Products:-
Rubber Ducky™ Gold fish & Tank David Byrne and My Fair Lady - MP3 file download (0 MB)
I want the output with coma like this
Rubber Ducky™, Gold fish & Tank, David Byrne, My Fair Lady MP3 file download (0 MB)
how it is possible with PHP?
This will print a ‘, ‘ between item names.
Alternatively, you could also do that: