I am trying to create an array to hold shopping cart information.  The array
I am using is called "cartArray".  What I want to do is to define a
sub-array of cartArray with the information from one product.  Then the next
time a product is added it appends then new information as a second
sub-array to cartArray and so forth.  Following is some code I have been
using to test with and so far PHP will let me use ".=" to append but when I
try to call it back with "print_r" or echo array[][] only the first entry is
returned.  Any ideas what I am doing wrong?

 $itemname="Some Item Name";
 $cartArray[] .= array(0=>array($itemnumber=>"$brand", "$itemqty",
 $itemname="Another Item Name";
 array_push($cartArray, array($itemnumber=>"$brand", "$itemqty",
 echo $cartArray[0][0]."<BR><BR>";

Thank you,
Jonathan Duncan

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to