php implode but not consider extra delimiter
<p>I have a string like following:</p>

<pre><code>test1, test2, test3, test4,
</code></pre>

<p>When I use the implode function on this I get back that there are 5 elements in the array.  </p>

<p>How can i not take into account the last extra comma ?</p>

<p>or better yet, how can i substring that so that there is no extra comma in the end.</p>
