Ich benutze array_multisort
wie immer, aber dieses Mal hat es Probleme beim Sortieren richtig.array_multisort funktioniert nicht richtig?
ich es verwenden, um ein mehrdimensionales Array zu sortieren ($ data), aber ich vereinfacht das Problem in diesem Beispiel:
$data = array(6 => 'WEEK 48', 7 => 'WEEK 49', 8 => 'WEEK 47', 9 => 'WEEK 50', 10 => 'WEEK 51');
$sort = array(8 => 201647, 6 => 201648, 7 => 201649, 9 => 201650, 10 => 201651);
array_multisort($sort, SORT_ASC, $data);
Output:
Array
(
[0] => WEEK 48
[1] => WEEK 49
[2] => WEEK 47
[3] => WEEK 50
[4] => WEEK 51
)
Was bin ich?
Scheint Ihre Eingabeparameter werden iCorrect http://www.w3schools.com/Php/func_array_multisort.asp Sie $ sort Array Sortierung anstelle von $ data – VadimB