I used several different posts on this site to figure out how to remove the last comma in a string. Apparently it's a classic question, but what I can't figure out is why it's adding an extra white space before the comma and not after the comma as one would expect?
As always I've played around with the code but I can't figure out where the extra white space comes from, please help me I'm going blind!
<?php $comma = ""; ?><?php foreach ($tags as $tag) { ?>
<?php echo $comma; ?><a href="<?php echo $tag['href']; ?>">
<?php echo $tag['tag']; ?></a><?php $comma = ","; ?>