From an API request I receive JSON data. This is a dump of the array
Array(
[0] => Array(
[id] => 28257
[price] => 18.50
[meta_data] => Array(
[0] => Array(
[id] => 522793
[key] => meta_image_out
[value] => motor-watermerk.png
)
[1] => Array(
[id] => 522794
[key] => saveLoc
[value] => Balie
)
)
)
)
The data what I want is the value from
[1] => Array(
[id] => 522794
[key] => saveLoc
[value] => Balie
)
for this I can use
echo $array[0]['meta_data'][1]['value'];
But the sequence from the array can be different and this code works not anymore.
$array[0]['meta_data'][**1**]['value'];
Number 1 can also 2, 3, 4...
How can I get always this value from the array?
The key is always saveLoc