How to remove last comma (,) from array?
<p>I've gone through this address:</p>

<p><a href="http://stackoverflow.com/questions/907806/php-mysql-using-an-array-in-where-clause">PHP/MYSQL using an array in WHERE clause</a></p>

<p>and found that if I use a join clause to separate values <code>,</code> is also at the end of the array. How can I remove last?</p>

<p>I am using like this </p>

<pre><code>$ttst=array();
$ttst=array(); 
$tt = "SELECT frd_id FROM network WHERE mem_id='$userId'"; 
$appLdone = execute_query($tt, true, "select"); 
foreach($appLdone as $kk=&gt;$applist){ 
    $ttst[] = $applist['frd_id']; 
} 
$result = implode(',', $ttst); 
</code></pre>

<p>then also coming last ,</p>

<p>Thanks.</p>

<hr>

<p>but it doesn't give single quote to each value .</p>
