My array $a defines the sorting of my elements:
array:4 [▼
"rabbit" => "201"
"cat" => "0"
"monkey" => "100"
"horse" => "0"
]
array $b defines a number:
array:4 [▼
"rabbit" => "9144"
"cat" => "10244"
"monkey" => "10068"
"horse" => "9132"
]
I try to sort now the numbers by the sorting element. The result I am looking for is:
array:4 [▼
1 => "9144"
2 => "10068"
3 => "10244"
4 => "9132"
]
I try to achieve this with "array_combine":
$c=array_combine($a,$b);
krsort($c);
But because of the zero I am loosing one element:
array:3 [▼
201 => "9144"
100 => "10068"
0 => "9132"
]