title: Remove array of items from session shopping cart
body: <p>I have an array of items kept in session cart. It gets populated in a table. each row has an index and  a button to remove this particular item(items array) from $_SESSION['cart']..</p>
  
  <p>This is the code I have at the moment:</p>
  
  <pre><code> $i = 0;
   foreach($_SESSION['cart'] as $item)
  {
      //Populate items in a table  ?&gt;
  &lt;tr&gt;
  &lt;td&gt;&lt;center&gt;&lt;?php echo $i; ?&gt;&lt;/center&gt;&lt;/td&gt;
  &lt;td&gt;&lt;center&gt;&lt;?php echo $item['item'];?&gt;&lt;/center&gt;&lt;/td&gt;
  &lt;td&gt;&lt;center&gt;&lt;?php echo '£'. $item['unitprice'];?&gt;&lt;/center&gt;&lt;/td&gt;
  &lt;td&gt;&lt;center&gt;&lt;?php echo $item['quantity'];?&gt;&lt;/center&gt;&lt;/td&gt;
      &lt;td&gt;&lt;center&gt;&lt;?php echo '£'.($item['unitprice'] * $item['quantity']) ?&gt;&lt;/center&gt;&lt;/td&gt;
  &lt;td&gt;&lt;input type="submit" value="Remove" Onclick =  unset($_SESSION['cart'][$i]); &gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;?php
   $total += ($item['unitprice'] * $item['quantity']);
  $i++;
  }
  </code></pre>
  
  <p>All I want to do is to remove one single row of data (each row contains index, item, item price, total(if there are more than one item) and remove button) from session cart. Thanks in advance..</p>