-1
您好,我實際上是想在第三級用不同的鍵排序數組。PHP ARRAY排序在第三級
以下是樣本數組輸入。
Array
(
[19067] => Array
(
[Morrisville, PA] => 5.02
)
[18977] => Array
(
[Washington Crossing, PA] => 6.63
)
[08695] => Array
(
[Trenton, NJ] => 2.84
)
[08690] => Array
(
[Trenton, NJ] => 1
)
[08666] => Array
(
[Trenton, NJ] => 2.84
)
[08650] => Array
(
[Trenton, NJ] => 0
)
[08648] => Array
(
[Lawrence Township, NJ] => 2.88
)
[08647] => Array
(
[Trenton, NJ] => 2.84
)
[08646] => Array
(
[Trenton, NJ] => 2
)
)
任何機構可以幫我在第三級以上數組進行排序
預期結果想:
輸出:
Array
(
[08650] => Array
(
[Trenton, NJ] => 0
)
[08690] => Array
(
[Trenton, NJ] => 1
)
[08646] => Array
(
[Trenton, NJ] => 2
)
[08666] => Array
(
[Trenton, NJ] => 2.84
)
[08695] => Array
(
[Trenton, NJ] => 2.84
)
[08647] => Array
(
[Trenton, NJ] => 2.84
)
[08648] => Array
(
[Lawrence Township, NJ] => 2.88
)
[19067] => Array
(
[Morrisville, PA] => 5.02
)
[18977] => Array
(
[Washington Crossing, PA] => 6.63
)
)
在此先感謝..
東西告訴我,浮點值並不總是適用於比較值...不知道我讀過那裏的內容:/否,+1 –
浮點在這裏很好。你的意思是'$ foo == 1.2345'通常不適用於浮點數,因爲它們的值不能保證精確。 – deceze
發現它,它會隱式投射到整數,所以0.1和0.99比較相同,這可能並不總是正確的:) –