I know this might have been asked a number of times. but in my case i get this error by using this
echo $result["tracks"]["title"];
Fatal error: Cannot use object of type stdClass as array in C:\wamp\www\withheader.php on line 26
and by using print_r ($result);
I get the following result
I want to get the result of array tracks and the element title. so ideally the output should be a variable with value DHL (Deprecated)
stdClass Object ( [increment_id] => 100000045 [store_id] => 1 [created_at] => 2015-09-07 07:34:06 [updated_at] => 2015-09-18 06:02:02 [shipping_address_id] => 441 [order_id] => 224 [total_qty] => 2.0000 [shipment_id] => 48 [items] => Array ( [0] => stdClass Object ( [parent_id] => 48 [sku] => testsimpleadmin [name] => testsimpleadmin [order_item_id] => 642 [product_id] => 57050 [weight] => 2.0000 [price] => 100.0000 [qty] => 1.0000 [item_id] => 96 ) [1] => stdClass Object ( [parent_id] => 48 [sku] => 12121221 [name] => women fancy bag [order_item_id] => 643 [product_id] => 57090 [weight] => 1.0000 [price] => 71.0000 [qty] => 1.0000 [item_id] => 97 ) ) [tracks] => Array ( [0] => stdClass Object ( [parent_id] => 48 [created_at] => 2015-09-18 06:02:02 [updated_at] => 2015-09-18 06:02:02 [carrier_code] => dhl [title] => DHL (Deprecated) [number] => 456 [order_id] => 224 [track_id] => 5 ) ) [comments] => Array ( ) )