In this tutorial learn how to replace the keys in an array with another set of keys in php.
function replaceKeys($array, $keys) { $values = array_values($array); return array_combine($keys, $values); }