Jump to content

accessing part of an object


beedie

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.