1
計數相同的值,我想去多維數組的最深/最後一級計算相同的值:PHP:在多維數組
Array
(
[svote001] => Array
(
[0] => 006
[1] => 006
[2] => 007
)
[svote002] => Array
(
[0] => 000
[1] => 000
[2] => 000
)
[svote003] => Array
(
[0] => 002
[1] => 003
[2] => 001
)
)
轉換爲
Array
(
[svote001] => Array
(
[006] => 2
[007] => 1
)
[svote002] => Array
(
[000] => 3
)
[svote003] => Array
(
[001] => 1
[002] => 1
[003] => 1
)
)
的計數值應另外從高到低排序。
該數組是否始終爲二維? – Flixer
是的,數組始終是二維的,所有「內部」數組的值都是相同的:所有3個值或4或5 ... –