title: Removing an item from shopping cart array
body: <p>I'm building a shopping cart, I save the orders in a multidimensional array which is stored in a session, <code>$_SESSION['cart']</code></p>
  
  <p>A product is represented by something like</p>
  
  <pre><code>$product_array=array($id,$description,$price);
  </code></pre>
  
  <p>The multidimensional array is the array of the <code>$product_array.s</code></p>
  
  <p>The <code>$id's</code> are unique.</p>
  
  <p>The issue is, When i want to remove a product from the multidimensional <code>$_SESSION['cart']</code> 
  array based on the id, it works if it's just one item in the cart, but if more, it doesn't work, the items seems to be removed but it's 'ghost' is left behind in the cart. The code
  is something like this :</p>
  
  <pre><code>//get $id, $count is elements in array  
  
  for ($r = 0; $r &lt;= $count-1; $r++) 
  {
     if($_SESSION['cart'][$r][0]=="$id")
     {
   unset($_SESSION['cart'][$r]); 
  
   echo "&lt;div class=success&gt;The item has been removed from your shopping cart.&lt;/div&gt;";
   break;
     }
  }
  </code></pre>