arrays - iterating over things in php -
this question has reply here:
php: public, private, protected 13 answersi have array called $options. want iterate through it's contents, do:
foreach($options $option){ print_r( $option); } the resulting output gives me object/array heffalump starts 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 reference values in _data, stumped right syntax this...
there's no syntax access them generic code. mage_bundle_model_option class has declared properties protected, means can accessed class, decendants, or ancestors. should utilize class's public methods create utilize of it, not access properties directly.
php arrays loops object
No comments:
Post a Comment