i have an PHP array in the following format,
Array
(
[0] => Array
(
[40] => 2
[80] => 1
[20] => 0
[60] => 0
[100] => 0
)
[1] => Array
(
[60] => 2
[80] => 1
[20] => 0
[40] => 0
[100] => 0
)
)
Expected output is (20=>0,40=>0,60=>2,80=>1 etc)
i tried using array_values and array_combine, but no luck.
How do i sort array by key using PHP.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…