I have something like a json array output, it comes like :
{
"data": [
{
"color"
"size"
"id"
"weight"
},
{
"color"
"size"
"id"
"weight"
},
And so on.
The array name is called $cars.
I need to loop through all the array and get all car sizes.
something like:
foreach ($cars as $value) {
$carsize=[data][i][size]
Thanks.
Make sure you parse into an array when using
json_decode(), then iterate over the data like so: