wds Posted July 20, 2007 Share Posted July 20, 2007 here's my dilemma, i want to create my cart array to house all of the customer's selections. the $image array will serve two purposes. $image will be used to identify which image they wish to purchase, and with each image there will be 3 values denoting the quantity of each size of picture they want (4x6, 5x8, & 8x10). now, i can call for the value of $cart[3]['four'][0] just fine, as long as the sub-arrays "five" and "eight" do not exist. any ideas how to go about this? THIS SCRIPT WORKS: $image = 3; $cart = array( $image => array( "four" => array( "3" ) ) ); print("<html><head></head><body>" . $cart[3]['four'][0] . "</body></html>"); THIS SCRIPT DOES NOT WORK: $image = 3; $cart = array( $image => array( "four" => array( "3" ) "five" => array( "4" ) "eight" => array( "1" ) ) ); print("<html><head></head><body>" . $cart[3]['four'][0] . "</body></html>"); THIS IS DRIVING ME CRAZY. Thank you for your input. Quote Link to comment Share on other sites More sharing options...
clearstatcache Posted July 20, 2007 Share Posted July 20, 2007 u try ds.... THIS SCRIPT DOES NOT WORK: $image = 3; $cart = array( $image => array( "four" => array( "3" ), "five" => array( "4" ), "eight" => array( "1" ) ) ); print("<html><head></head><body>" . $cart[3]['four'][0] . "</body></html>"); Quote Link to comment Share on other sites More sharing options...
wds Posted July 21, 2007 Author Share Posted July 21, 2007 clear, thank you so much!!! i can't believe it was just a simple syntax error... sometimes it's just the simplest things, i can't believe i overlooked that!!! i am so happy right now, cheers to you sir. Quote Link to comment Share on other sites More sharing options...
clearstatcache Posted July 21, 2007 Share Posted July 21, 2007 ur welcum....godblez u.... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.