title: delete data from array
body: <p>I have this issue with deleting a data from an array(session).</p>
  
  <p>Well, my code is:</p>
  
  <pre><code>$cart = $this-&gt;session-&gt;userdata('cart');
  $sess_product_name = $cart['product_name'];
  $sess_prod_id = $this-&gt;input-&gt;post('sess_prod_id');
  
  foreach($sess_product_name as $key =&gt; $value) :
      if($key == $sess_prod_id) :
          unset($sess_product_name[$value]);
          $sess_product_name = array_values($sess_product_name);
      endif;
  endforeach;
  </code></pre>
  
  <p>Even so, the array is not changing in any way :( please help</p>
  
  <p>Thank you very much for helping!</p>