I have a shopping cart that is a multidimensional array:
$product = array("ID"=>$id1, "name"=> $name1, "colour"=>$colour1, "quantity"=>$quantity1, "size"=>$size1, "price"=>$price1);
$cart[$pos] = $product;
When I try to delete an item in a different file:
<?php
session_start();
$item=$HTTP_GET_VARS['delete'];
//unset($cart[$item]);
$i=item;
for ($i; $i<$pos; $i++){
$cart[$i] = $cart[$i+1];
}
$cart = array_pop($cart);
//unset($cart[$pos]);
print_r($cart);
?>
I get the following message:
Fatal error: Allowed memory size of 8388608 bytes exhausted at zend_hash.c:260 (tried to allocate 40 bytes) in delete.php on line 11
Fatal error: Allowed memory size of 8388608 bytes exhausted at /usr/local/src/php-4.1.0_patched/ext/standard/php_smart_str.h:74 (tried to allocate 139 bytes) in Unknown on line 0
Why???? Do I need to free memory somehow, I only have 3 items in my cart....