title: Removing last comma from a foreach loop
body: <p>Im using a foreach loop to echo out some values from my database and seperating each of them by commas but I dont know how to remove the last comma it adds on the last value.</p>
  
  <p>My code is pretty simple but I just cant seem to find the correct way of doing this:</p>
  
  <pre><code>foreach ($this-&gt;sinonimo as $s){ 
  
  echo '&lt;span&gt;'.ucfirst($s-&gt;sinonimo).',&lt;/span&gt;';
  
  }
  </code></pre>
  
  <p>Thanks in advance for any help :)</p>