I want to sort this array on basis of 'eta'.Lowest eta must come to first.
My array is :
Array
(
[0] => Array
(
[company] => Uber
[type] => Saloon
[eta] => 8
[destination_required] => N
[reject_booking_request] => N
)
[1] => Array
(
[company] => greentomato
[type] => Saloon
[company_rating] => 80%
[eta] => 10
[destination_required] => N
[reject_booking_request] => N
)
[2] => Array
(
[company] => CATALINA
[type] => Exec
[eta] => 12
[destination_required] => Y
[reject_booking_request] => N
)
[3] => Array
(
[company] => Uber
[type] => Exec
[eta] => 15
[destination_required] => N
[reject_booking_request] => N
)
[4] => Array
(
[company] => Hailo
[type] => Taxi
[eta] => 1
[destination_required] => Y
[reject_booking_request] => Y
)
)
I want to sort this array on basis of 'eta'.Lowest eta must come to first.
I tried to use this :
$result = Set::sort($array, '{n}', 'asc');
But it gives some error.