I have returned data from json_decode
$xml = json_decode($res);
$data=$xml->Item;
And when dump $data
in my code
array:1 [▼
0 => {#500 ▼
+"productCode": "ddddddddddddd"
+"productNameEN": "xxxxxxxxxxxxxxxxx"
+"show_in_web": "aaaaaaaaaaa"
+"visible": "N"
}
]
I need to count object in each array.
foreach( $data as $itm ){
dump(count($itm));die();
}
I used count() in foreach loop result return 1. Please help me.