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 called array_keys and array_values:
$array_keys = array_keys($array); $array_values = array_values($array);