title: Create a comma-separated string from a single column of an array of objects
body: <p>I'm using a foreach loop to echo out some values from my database, I need to strip the last comma from the last loop if that makes sense.</p>
  <p>My loop is just simple, as below</p>
  <pre><code>foreach($results as $result){
    echo $result-&gt;name.',';
  }
  </code></pre>
  <p>Which echos out</p>
  <pre><code>result,result,result,result,
  </code></pre>
  <p>I just need to kill that pesky last comma.</p>