Ich habe ein mehrdimensionales Array und will, dass es nach der Entfernung sortieren:Multisort nach Entfernung
[clustermarkers] => [
0 => [
0 => [
'name' => 'A',
'distance' => 10
]
],
1 => [
0 => [
'name' => 'B',
'distance' => 8
]
],
...
];
Ich habe versucht, usort Funktion, aber etwas nicht in Ordnung:
usort($clustermarkers, function($a, $b) {
return (int)$a['distance'] - (int)$b['distance'];
});
Notice: Undefined index: Abstand – user889349