I have updated my question so please check it.
I have one array like below:
$array = [
0 => [
"term" => "DECATHLON",
"count" => 7,
],
1 => [
"term" => "babywalz",
"count" => 6,
],
2 => [
"term" => "Douglas",
"count" => 3,
],
3 => [
"term" => "NETFLIX",
"count" => 2,
],
4 => [
"term" => "zalando",
"count" => 2,
],
5 => [
"term" => "Ernsting's family",
"count" => 1,
],
6 => [
"term" => "Spotify",
"count" => 1,
],
7 => [
"term" => "eventim",
"count" => 1,
]
];
I want to sort array like this:
$array = [
1 => [
"term" => "babywalz",
"count" => 6,
],
0 => [
"term" => "DECATHLON",
"count" => 7,
],
2 => [
"term" => "Douglas",
"count" => 3,
],
5 => [
"term" => "Ernsting's family",
"count" => 1,
],
7 => [
"term" => "eventim",
"count" => 1,
],
3 => [
"term" => "NETFLIX",
"count" => 2,
],
6 => [
"term" => "Spotify",
"count" => 1,
],
];
Any suggestions will be helpful. I have used asort(), but it doesn't work as I want. Also I have tried with natcasesort().