我正在玩 opencart 并尝试向购物车的过滤器功能添加一些新功能。
我想知道如何有效地计算多维 php 数组中给定值的出现次数?例如,我正在尝试使用我们的 if all Filter->Count == 0?
Array
(
...
[filter] => Array
(
[0] => Array
(
[filter_id] => 109
[name] => Boyfriends (0)
[count] => 0
)
[1] => Array
(
[filter_id] => 114
[name] => Daughters (0)
[count] => 0
)
[2] => Array
(
[filter_id] => 115
[name] => Fathers (0)
[count] => 0
)
[3] => Array
(
[filter_id] => 108
[name] => For Her (53)
[count] => 53
)
...
)
...
)