Hi,
I am trying to get the values of field1 and field20 from the following unserialized output:
stdClass::__set_state(array( 'id' => 'xxx', 'products' => stdClass::__set_state(array( 'product' => stdClass::__set_state(array( 'field1' => '123', 'field2' => '', 'field3' => stdClass::__set_state(array( )), #various other fields 'field20' => '456', )), )), ))
I have tried this code but it doesn't seem to be working, can someone tell me what I am doing wrong here please?
$result = unserialize($api->getResponseSerialized()); foreach ($result->products->product as $product) { $product->field1; //doesnt work!!! }