Is there an easy way to split an array into two arrays, one consisting of all the keys and the other consisting of all the values? This would be a reverse to the action of
There are two functions actually:
$keys = array_keys($array); $values = array_values($array);
You can also do the exact opposite:
$array = array_combine($keys, $values);