title: Removing last comma from string (Wordpress)
body: <p>How can I remove the last comma from this loop code(wordpress)?</p>
  
  <pre><code>foreach((get_the_category()) as $category){ 
  echo $category-&gt;name.", ";
  } 
  </code></pre>