okay, okay
i know this topic was hammered to death already
but still the PHP docs are VERY user-unfriendly when coming to compulsory and detailed explanations/examples...
i'm doing some small session-based shopping cart. what i need is to define a two-dimensional array ($cart for example) then pass a pairs of values to it ($item and $count, respectively, in conjunction), then i'll check the array for the duplicates of items and increase their $count values, then i'll end up getting the correct price values from mysql database and sum up the shopping cart.
okay, what the init/put/get strings for my $cart array would look like ? list() and each() just won't work for me cause i'm a no guru in the php syntax.
see:
if($item) $cart[] =
need to assign a pair of values here
----------
while(list($pos,$val)=each($cart))
{echo "$pos=>$val<br>";}
^^^^ need to retrieve a pair of values here, not the pos/value, but actual item/count pair.
ideas ?