Array
(
[id] => 7.8803211967429E+17
[title] => Example T-Shirt
[body_html] =>
[variants] => Array
(
[0] => Array
(
[id] => 6.4266704147271E+17
)
[1] => Array
(
[id] => 7.576504846442E+17
[product_id] => 7.8803211967429E+17
)
)
[options] => Array
(
[0] => Array
(
)
)
)
I need to get IDs from each main array. I get this array from decoding json using:
<?php
set_time_limit(0);
$json = file_get_contents('imarasoft.net/imarasoft/abd/WebHook/response.txt');
$arrays = json_decode($json, true);
print_r($arrays);
foreach ($arrays as $array) {
echo $array["id"];
}
How can I print ID using foreach? i HAVE EDITED THE QUESTION AND HAVE GIVEN THE FULL ARRAY FORMAT