beedie Posted October 22, 2008 Share Posted October 22, 2008 I want to access this part of the object: [6]=> string(3) "299" What would my code be? Help much appreciated. BElow is the var_dump of the session. <?php object(shoppingCart)#4 (9) { ["contents"]=> array(1) { ["20:bc427133333b4d5454544569e9db1fba7"]=> array(2) { ["qty"]=> string(1) "1" ["attributes"]=> array(3) { [0]=> string(2) "96" [6]=> string(3) "299" [7]=> string(3) "300" } } } ["total"]=> float(27.95) ["weight"]=> int(1) ["cartID"]=> string(5) "34757" ["content_type"]=> string( "physical" ["free_shipping_item"]=> int(0) ["free_shipping_weight"]=> int(0) ["free_shipping_price"]=> int(0) ["observers"]=> array(0) { } } ?> Link to comment https://forums.phpfreaks.com/topic/129649-accessing-part-of-an-object/ Share on other sites More sharing options...
wildteen88 Posted October 22, 2008 Share Posted October 22, 2008 Umm is that the output of print_r or var_dump or something? As that is not valid code. Link to comment https://forums.phpfreaks.com/topic/129649-accessing-part-of-an-object/#findComment-672170 Share on other sites More sharing options...
beedie Posted October 22, 2008 Author Share Posted October 22, 2008 yes it is i modified my post while you were posting var_dump Link to comment https://forums.phpfreaks.com/topic/129649-accessing-part-of-an-object/#findComment-672174 Share on other sites More sharing options...
wildteen88 Posted October 23, 2008 Share Posted October 23, 2008 Whats the original code? Link to comment https://forums.phpfreaks.com/topic/129649-accessing-part-of-an-object/#findComment-672887 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.