PHP Remove items from Array?
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/2448964/php-how-to-remove-specific-element-from-an-array">PHP: How to remove specific element from an array?</a>  </p>
</blockquote>



<p>I've got an array for holding shopping basket information:</p>

<pre><code>session_start();

$items = $_SESSION['items'];
$values = $_SESSION['values'];


if (isset($_POST['addtobasket']))
{


       $items[] = $_POST['item'];
       $values[] = $_POST['value'];
       $_SESSION['items'] = $items;
       $_SESSION['values'] = $values;
}

        print("Added " . $_POST['item'] . " with value of " . $_POST['value'] . "to basket");

?&gt;
</code></pre>

<p>At the checkout screen I'd like to be able the user to be able to remove items:</p>

<pre><code>&lt;?                                  
                            echo "&lt;table class='basketdisplay'&gt;";
                            echo "&lt;tr&gt;&lt;td&gt;Item&lt;/td&gt;&lt;td&gt;Price&lt;/td&gt;&lt;/tr&gt;";
                            foreach($items as $key =&gt; $item)
                            {                                  
                                   echo "&lt;tr&gt;"; 
                                   echo "&lt;td&gt;" . $item . "&lt;/td&gt;";
                                   echo "&lt;td&gt;£" . $values[$key] . "&lt;/td&gt;"; 
                                   echo "&lt;td&gt;" . $key . "&lt;/td&gt;";
                                   echo "&lt;/tr&gt;";      
                            }



                            echo "&lt;/table&gt;";
?&gt;
</code></pre>

<p>So instead of the last column showing the key, some form of button to remove the item at that key?</p>

<p>Does anyone know how I'd go about this, my php is not strong. TIA</p>
