我有一个多维数组。我想搜索值(用户名IE jon)并计算特定用户名的总“YES”。
IE 根据下面的数组 Andew 重复三次索引 1,3,4,其值为“YES”,因此 Andrew 的总“YES”计数值 = 3
Jon 重复两次,但其值为“NO”,因此其值为 = 0
Array
(
[0] => Array
(
[0] => Jon
[1] => NO
)
[1] => Array
(
[0] => Andew
[1] => NO
)
[2] => Array
(
[0] => Walid
[1] => YES
)
[3] => Array
(
[0] => Andew
[1] => YES
)
[4] => Array
(
[0] => Andew
[1] => YES
)
[5] => Array
(
[0] => Jon
[1] => NO
)
[6] => Array
(
[0] => Andew
[1] => YES
)
)
我想让用户作为键和值 = 计算“是”的总数。
输出
Array
(
john => 0,
Andew => 3
Walid => 1
)
任何人,请建议一个可能的解决方案?
动漫人物
holdtom
拉莫斯之舞