title: php: how to get single value from a comma(,) separated array
body: <p>i have applied tags functionality in my project just like stack overflow.</p>
  
  <p>When i subit multiple tags from my form, and in my controller
   i am getting it like this:</p>
  
  <p><code>$this-&gt;input-&gt;post('tags_id')</code>  so i am getting  <code>2,3,44,442</code> as the value for  <code>$this-&gt;input-&gt;post('tags_id')</code>  altogether.</p>
  
  <p><strong>What i want is</strong> i want the each value to be inserted into my tags table one by one.</p>
  
  <p>How can i get the each value from from the comma separated list to be inserted in my db?
  Please help me...</p>
  
  <p>I am doing the following to insert into my db</p>
  
  <pre><code>  function entry_insert_instdetails()
  { 
     $this-&gt;load-&gt;database();     
     $this-&gt;db-&gt;trans_begin();  
     $data=array('instrunction'=&gt; $this-&gt;input-&gt;post('tags_id'),   
     'creater_id'=&gt;$this-&gt;session-&gt;userdata('userid'), 
      ); 
      $this-&gt;db-&gt;insert('instructions',$data); 
  
    if ($this-&gt;db-&gt;trans_status() === FALSE)
      {
          $this-&gt;db-&gt;trans_rollback();
      }  
    else 
      {
          $this-&gt;db-&gt;trans_commit();
      }
  }
  </code></pre>