I\'m trying to sort a multi-dimensional array by another array, but have so far come up short. array_multisort seems be working only for real sorting.
Suppose I
There is no built-in function for this in PHP and i am unable to think of any custom function, which would do this using usort. But array_map is simple enough, imo, so why not use it instead?
$sorted = array_map(function($v) use ($data) { return $data[$v - 1]; }, $order);