I'm iterating over an array of objects, some of them nested in a non-uniform way. I'm doing the following:
foreach($response['devices'] as $key => $object) {
foreach($object as $key => $value) {
echo $key . " : " . "$value . "<br>";
}
}
Which works...until it hits the next embedded array/object, where it gives me an 'Notice: Array to string conversion in C:\xampp\htdocs\index.php on line 65' error
I'm relatively new to PHP and have thus far only had to deal with uniform objects. This output is far more unpredictable and can't be quantified in the same way. How can I 'walk' through the data so that it handles each array it comes across?