0

This is an array of wordpress tags.

There's a comma after each word.

How to easily remove comma from the last word of an array?

<?php
$posttags = get_the_tags();
if ($posttags) {
  foreach($posttags as $tag) {
    echo $tag->name . ', '; 
  }
}
?>
justdee
  • 71
  • 1
  • 1
  • 7

0 Answers0