title: only need to delete one product from my cart, not all products with same ID
body: <p>I don't understand why this code won't only delete the pizza_id with the given key that is passed through the URL. I echo back the <code>$_GET['key']</code> value to check if I have the desired number and it works fine. 
  The key value comes from another <code>foreach $key=&gt;$value</code> loop that builds the shopping cart and has a delete link with the pizza id and the $key in it.  </p>
  
  <pre><code>switch ($action) {
      case 'add':
          if ($cart) {
              $cart .= ','.$_GET['pizza_id'];
          } else {
              $cart = $_GET['pizza_id'];
          }
          break;
      case 'delete':
          echo "KEY: ".$_GET['key']."&lt;br&gt;";
          if ($cart) {
              $items = explode(',',$cart);
              $newcart = '';
              foreach ($items as $key =&gt; $item) 
              {
                  if ($_GET['pizza_id'] != $item &amp;&amp; $GET['key']!= $key ) 
                  {
                      if ($newcart != '') 
                      {
                          $newcart .= ','.$item;
                      } 
                      else 
                      {
                          $newcart = $item;
                      }
                  }
              }
              $cart = $newcart;
          }
          break;
  }
  </code></pre>
  
  <p>EDIT: maybe I should also mention the basis of the code comes from this webpage <a href="http://v3.thewatchmakerproject.com/journal/276/" rel="nofollow">http://v3.thewatchmakerproject.com/journal/276/</a></p>