I'm building a shopping cart, I save the orders in a multidimensional array which is stored in a session, `$_SESSION['cart']`

A product is represented by something like

```
$product_array=array($id,$description,$price);

```

The multidimensional array is the array of the `$product_array.s`

The `$id's` are unique.

The issue is, When i want to remove a product from the multidimensional `$_SESSION['cart']` 
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 :

```
//get $id, $count is elements in array  

for ($r = 0; $r <= $count-1; $r++) 
{
   if($_SESSION['cart'][$r][0]=="$id")
   {
 unset($_SESSION['cart'][$r]); 

 echo "<div class=success>The item has been removed from your shopping cart.</div>";
 break;
   }
}

```