计算多维数组中数据的出现次数

时间:2016-05-28 16:53:53

标签: php arrays multidimensional-array

需要帮助。我想使用PHP计算多维数组中数据的出现次数,但无法解决每个问题的使用问题。所以我在寻求帮助

示例数组

Array ( [0] => Array ( [id] => 100 [keys] => Array ( [0] => Array ( [id] => x181 ) [1] => Array ( [id] => x853 ) [2] => Array ( [id] => x890 ) ) )
[1] => Array ( [id] => 101 [keys] => Array ( [0] => Array ( [id] => x133 ) ) )
[2] => Array ( [id] => 102 [keys] => Array ( [0] => Array ( [id] => x904) [1] => Array ( [id] => x102 ) ) )
[3] => Array ( [id] => 103 [keys] => Array ( [0] => Array ( [id] => x121 ) ) ) )

我想计算每个ID的出现次数,例如

x181 1
x121 1 ...

0 个答案:

没有答案