How split a string separated by comma?
<p>i want display the string in comma separated by comma 
here is my code   </p>

<pre><code>   function GetItemIds()
       {
            $i=0;
          $qury="SELECT item_id FROM common.items ORDER BY item_id DESC LIMIT 10";
          $str="";
         $result= mysql_query($qury);
       while($result1= mysql_fetch_row($result))
       {

         if($i==0)
         {
           $str .= $result1[0];
         }
          else
         {
         $str .=",".$result1[0];
         }
      }

       echo $strs;

     }
</code></pre>

<p>but here i print str i have output 12345678 like this but i want 1,2,3,4 so please help me 
thanks in advance </p>
