Remove comma after last tag
-
Hi, how do I remove the comma after the last tag? I’ve been searching the forums and internet in general and so far I’ve gathered that it has something to do with rtrim, however after much trial and error I don’t know how to apply it specifically to my code (below):
<div id="tags"> <p><?php $posttags = get_the_tags(); if ($posttags) { foreach($posttags as $tag) { echo $tag->name . ' '; } } ?></p> </div>
Any assistance is much appreciated, thanks!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Remove comma after last tag’ is closed to new replies.