(Beginner's question) Echoing through an array in PHP, only adding a comma based on certain conditions?

If you want to do it manually, just prepend the comma before any tag but the first one. Use a control variable to detect the first tag.

You can buffer your output (the tags). Let's say you put them in an array.

Related Questions