Exchange values with keys
suggest changearray_flip
function will exchange all keys with its elements.
$colors = array(
'one' => 'red',
'two' => 'blue',
'three' => 'yellow',
);
array_flip($colors); //will output
array(
'red' => 'one',
'blue' => 'two',
'yellow' => 'three'
)
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents