0
我有一個巨大的一組像下面的數組。我想統計一輛汽車在同一個生產商ID下顯示的次數。我該怎麼做解析通過一個數組,並計數
[0] => Array
(
[Make] => Array
(
[ManufacturersName] => Nissan
[type] => 4Dr
[manufacturersID] => 1
)
[Car] => Array
(
[Model] => Mexima
)
)
[1] => Array
(
[Make] => Array
(
[ManufacturersName] => Nissan
[type] => 4Dr
[manufacturersID] => 1
)
[Car] => Array
(
[Model] => Mexima
)
)
[2] => Array
(
[Make] => Array
(
[ManufacturersName] => Toyota
[type] => 4Dr
[manufacturersID] => 2
)
[Car] => Array
(
[Model] => Corolla
)
)
在上面的示例,Maxima在Manufacturerid出現了兩次1
感謝
您可能需要添加一些檢查以查看製造商陣列和車鑰匙是否已存在,並在需要時添加它們。否則PHP會抱怨(輕微,但抱怨) – Flambino
不能正常工作 – Autolycus