title: How can I easily remove the last comma from an array?
body: <p>Let's say I have this:</p>
  
  <pre><code>$array = array("john" =&gt; "doe", "foe" =&gt; "bar", "oh" =&gt; "yeah");
  
  foreach($array as $i=&gt;$k)
  {
  echo $i.'-'.$k.',';
  }
  </code></pre>
  
  <p>echoes <code>"john-doe,foe-bar,oh-yeah,"</code></p>
  
  <p>How do I get rid of the last comma?</p>