I have 2 Arrays:
(1) Array with Key => Value, and Array (2) with no relevant Keys and as Values the keys from array 1 in different order. Is there an elegant solution to put array 1 in the same order like the values in array two?
$data = array(
'NAME' => 'XYZ',
'NUMB' => 1234,
'CITY' => 'TEST'
);
$sort = array(
'A1' => 'CITY',
'XY' => 'NUMB',
'XX' => 'NAME',
);
$result = array(
'CITY' => 'TEST,
'NUMB' => 1234,
'NAME' => 'XYZ',
);
'NUMB' => 1234.