Answer the question
In order to leave comments, you need to log in
How to sort such an array?
there is an array:
Array
(
[Pinaceae Lindl.] => Array
(
[aborigen_count_rod] => Array
(
[0] => 1
)
[aborigen_count_vid] => Array
(
[0] => 2
)
)
[Asteraceae Dumort.] => Array
(
[aborigen_count_rod] => Array
(
[0] => 1
)
[aborigen_count_vid] => Array
(
[0] => 1
)
)
[Adoxaceae Trautv.] => Array
(
[aborigen_count_rod] => Array
(
[0] => 1
)
[aborigen_count_vid] => Array
(
[0] => 3
)
)
[Magnoliopsida] => Array
(
[aborigen_count_rod] => Array
(
[0] => 1
)
[aborigen_count_vid] => Array
(
[0] => 1
)
)
)
Answer the question
In order to leave comments, you need to log in
uasort($count_data, function($a, $b) {
if ($a['aborigen_count_vid'][0] === $b['aborigen_count_vid'][0]) return 0;
return $a['aborigen_count_vid'][0] < $b['aborigen_count_vid'][0] ? 1 : -1;
});
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question