Basically i have an array of key mappings (actually translations) and an array of data values. I want to essentially replace the keys of the second array with the values of the first array.
E.G.:
$array1 = array(
'key1' => 'newkey1',
'key2' => 'newkey2',
'key3' => 'newkey3',
'key4' => 'newkey4'
);
$array2 = array(
'key1' => 'data1',
'key2' => 'data2',
'key3' => 'data3',
'key4' => 'data4',
'key5' => 'data5',
'key6' => 'data6'
);
$result = array(
'newkey1' => 'data1',
'newkey2' => 'data2',
'newkey3' => 'data3',
'newkey4' => 'data4'
);
Edit: Added excess data to second array