I am using this code
<?php
foreach($rows as $row) {
echo "<a href=index.html?id=" . $row['id'] . ">" . $row['name'] . "</a>, ";
}
?>
The problem is that the comma and space (,<space>) are added to even the last $row. What is the simplest method to prevent this? I had an idea to check the size of the array etc. but not sure if this would be over complicating it.