shopping cart array
Here is the code when i had an item to the cart its fine it counts up as it should but when i  compare the array and it gos to the else it crashes any help would be ace




[code]

 //IF NOT IN CART
	if(!isset($_SESSION['cart'])){
 $_SESSION['cart'] = array(array('id' => $id, 'colour' => $colour, 'size' => $size, 'quantity' => $quantity));
							   }else{
						   
						   foreach($_SESSION['cart'] as $key => $value){
							   //IF IT IS IN THE CART IM CHECKING TO SEE IF SAME
							   if($value['id'] == $id && $value['colour'] == $colour && $value['size'] == $size){
								        // ADDING ONE TO THE CART IF SAME
								        $quantity = $value['quantity']+=1;
							            $_SESSION['cart'] = array(array('id' => $id, 'colour' => $colour, 'size' => $size, 'quantity' => $quantity));
										
								   
								   
								   
								   }else{											
								        $_SESSION['cart'][] = array(array('id' => $id, 'colour' => $colour, 'size' => $size, 'quantity' => $quantity));
										}
							           }
							          }
									  
						            foreach($_SESSION['cart'] as $cart => $value){
										  
										  while(list($k, $v) = each($value)){
											  
											  echo $v;
											  
											  }
										  }[/code]
shopping cart array
===

Here is the code when i had an item to the cart its fine it counts up as it should but when i  compare the array and it gos to the else it crashes any help would be ace




[code]

 //IF NOT IN CART
	if(!isset($_SESSION['cart'])){
 $_SESSION['cart'] = array(array('id' => $id, 'colour' => $colour, 'size' => $size, 'quantity' => $quantity));
							   }else{
						   
						   foreach($_SESSION['cart'] as $key => $value){
							   //IF IT IS IN THE CART IM CHECKING TO SEE IF SAME
							   if($value['id'] == $id && $value['colour'] == $colour && $value['size'] == $size){
								        // ADDING ONE TO THE CART IF SAME
								        $quantity = $value['quantity']+=1;
							            $_SESSION['cart'] = array(array('id' => $id, 'colour' => $colour, 'size' => $size, 'quantity' => $quantity));
										
								   
								   
								   
								   }else{											
								        $_SESSION['cart'][] = array(array('id' => $id, 'colour' => $colour, 'size' => $size, 'quantity' => $quantity));
										}
							           }
							          }
									  
						            foreach($_SESSION['cart'] as $cart => $value){
										  
										  while(list($k, $v) = each($value)){
											  
											  echo $v;
											  
											  }
										  }[/code]