2
我有一個數組看起來像這樣在PHP排序關聯數組的鍵值
Array
(
[0] => Array
(
[width] => 1
[ladiesSeat] =>
[fare] => 610
[zIndex] => 0
[serviceTaxAmount] => 35.38
[commission] =>
[operatorServiceChargeAbsolute] => 0
[operatorServiceChargePercent] => 0
[totalFareWithTaxes] => 645.38
[bookedBy] =>
[ac] =>
[sleeper] =>
[serviceTaxPer] => 5.8
[available] => 1
[row] => 0
[column] => 2
[length] => 1
[id] => M1
)
[1] => Array
(
[width] => 1
[ladiesSeat] =>
[fare] => 610
[zIndex] => 0
[serviceTaxAmount] => 35.38
[commission] =>
[operatorServiceChargeAbsolute] => 0
[operatorServiceChargePercent] => 0
[totalFareWithTaxes] => 645.38
[bookedBy] =>
[ac] =>
[sleeper] =>
[serviceTaxPer] => 5.8
[available] => 1
[row] => 1
[column] => 0
[length] => 1
[id] => L21
)
...............
...............
[n] => Array
(
[width] => 1
[ladiesSeat] =>
[fare] => 610
[zIndex] => 0
[serviceTaxAmount] => 35.38
[commission] =>
[operatorServiceChargeAbsolute] => 0
[operatorServiceChargePercent] => 0
[totalFareWithTaxes] => 645.38
[bookedBy] =>
[ac] =>
[sleeper] =>
[serviceTaxPer] => 5.8
[available] => 1
[row] => 0
[column] => 0
[length] => 1
[id] => L21
)
)
我要排序的基礎上按升序排列row
和column
鍵的值數組。 這是預期的結果。
Array
(
[0] => Array
(
[width] => 1
[ladiesSeat] =>
[fare] => 610
[zIndex] => 0
[serviceTaxAmount] => 35.38
[commission] =>
[operatorServiceChargeAbsolute] => 0
[operatorServiceChargePercent] => 0
[totalFareWithTaxes] => 645.38
[bookedBy] =>
[ac] =>
[sleeper] =>
[serviceTaxPer] => 5.8
[available] => 1
[row] => 0
[column] => 0
[length] => 1
[id] => M1
)
[1] => Array
(
[width] => 1
[ladiesSeat] =>
[fare] => 610
[zIndex] => 0
[serviceTaxAmount] => 35.38
[commission] =>
[operatorServiceChargeAbsolute] => 0
[operatorServiceChargePercent] => 0
[totalFareWithTaxes] => 645.38
[bookedBy] =>
[ac] =>
[sleeper] =>
[serviceTaxPer] => 5.8
[available] => 1
[row] => 0
[column] => 2
[length] => 1
[id] => L21
)
...............
...............
[n] => Array
(
[width] => 1
[ladiesSeat] =>
[fare] => 610
[zIndex] => 0
[serviceTaxAmount] => 35.38
[commission] =>
[operatorServiceChargeAbsolute] => 0
[operatorServiceChargePercent] => 0
[totalFareWithTaxes] => 645.38
[bookedBy] =>
[ac] =>
[sleeper] =>
[serviceTaxPer] => 5.8
[available] => 1
[row] => 1
[column] => 2
[length] => 1
[id] => L21
)
)
即當我打印整理相關陣列 在row
和column
鍵的值就應該是這樣的方式。
00
02
12
那我該如何排序呢?