The tags show up in a row separated by commas. The trouble now is that behind the last tag there’s still a comma. I know somehow i can trim a comma off a string by using
rtrim
but I can’t seem to find a way to integrate it into my code. will I need to put in an extra function?
Yes, I thought that was the idea? The comma is the delimiter where you separate the tags. If you want to add some commas afterwards, you can put them in again and the best way to approach this would be with CSS instead of adding the comma after the <a> tag, so if you add a class to your <a> tag
I don’t think you could easily trim the comma, if you add it in the html like above. If you put it in a span tag, you could then hide the last comma via css, but that would be ugly, too. Or you could count the tags and then only add the comma, if its not the last tag, but then again that would require quite a bit of unnecessary code.