remove last comma from a list wordpress code example
Example: remove last comma from a list wordpress
$posttags = get_the_tags();
if ($posttags) {
$taglist = "";
foreach($posttags as $tag) {
$taglist .= $tag->name . ', ';
}
echo rtrim($taglist, ", ");
}