Sunday, May 12, 2019

arrays - iterating over things in php

I have an array called $options.
I want iterate through it's contents, so I do:



 foreach($options as $option){   
print_r( $option);
}



The resulting output gives me an object/array heffalump that starts like this...



Mage_Bundle_Model_Option Object
(
[_defaultSelection:protected] =>
[_eventPrefix:protected] => core_abstract
[_eventObject:protected] => object
[_resourceName:protected] => bundle/option
[_isObjectNew:protected] =>

[_data:protected] => Array
(
[option_id] => 20
[parent_id] => 291


I want to reference values in _data, but I am stumped as to correct syntax to do this...

No comments:

Post a Comment

plot explanation - Why did Peaches' mom hang on the tree? - Movies & TV

In the middle of the movie Ice Age: Continental Drift Peaches' mom asked Peaches to go to sleep. Then, she hung on the tree. This parti...