I have an array look like this
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
)
)
I want to sort this array based on the values of row
and column
keys in ascending order.
Here is the expected result.
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
)
)
ie when i print values of row
and column
key in the sorted associated array
it should look like this way.
00
02
12
So how can i sort it?