I have array something like:
Array(
[06:30 PM] => 2
[03:00 AM] => 3
[08:00 PM] => 4
)
So I have used uksort to sort the key and array will be sorted like:
Array(
[03:00 AM] => 3
[06:30 PM] => 2
[08:00 PM] => 4
)
And code I have used is:
uksort($arr, function($a, $b) {
return (strtotime(date('H:i',strtotime($a))) > strtotime(date('H:i',strtotime($b))));
});
This array is have time in Key and count of value as value.Now, I have another array which contain the value of above keys.
Array
(
[1] => Array
(
[0] => Default
[1] => BHU
)
[2] => Array
(
[0] => Default
[1] => HOT
[2] => COLD
)
[3] => Array
(
[0] => Default
[1] => Test
[2] => Test1
[3] => Test2
)
)
Now, I want to sort this array also as per above array sorted. How can I do that?
Thanks