I need walking trought json mixed arrays and objects.
I try, but get a [ErrorException] Array to string conversion
$epoJson = json_decode($json, true);
foreach (new RecursiveIteratorIterator(new RecursiveArrayIterator($epoJson), RecursiveIteratorIterator::CATCH_GET_CHILD) as $key => $value) {
echo 'My node ' . $key . ' with value ' . $value . PHP_EOL;
}
NOTE: I don't need a echo, var_dump or other , of course... I need iterate for put other code for work with values... code echo it's only for visualize problem... if I used echoot's for simple question: if $value, it's not string...
Try search some examples or libraries for walk on json mixed but not get anything.
http://sandbox.onlinephpfunctions.com/code/4bd4fbc5e43ed439add7d4ba497b830d498ce4ac