Question: Using Associative arrays
I'm trying to access a position of a associative array which is inside of another array.
Here is my array:
Array ( [order_data] => stdClass Object ( [id_order] => 2 [id_client] => 1 [date_order] => 2022-04-03 18:43:18 [address] => meu puto [city] => Rabinho [email] => [email protected] [cellphone] => 919788427 [code_order] => QX669156 [status] => PENDIG [message] => [created_at] => 2022-04-03 18:43:18 [updated_at] => 2022-04-03 18:43:18 ) [products_order] => Array ( [0] => stdClass Object ( [id_order_product] => 8 [id_order] => 2 [name_product] => Green Tshirt [price_unity] => 35.15 [quantity] => 1 [created_at] => 2022-04-03 18:43:18 ) ) )
Im trying to access the field which name is name_product and this is my code in order to do that:
$image = $order_details['products_order']['name_product']);
and this gives me the following error
Undefined array key "name_product"
probably it's just a simple thing.