Flip all keys with their associated values in an array in PHP
Description
The following code shows how to flip all keys with their associated values in an array.
Example
<?php/* ww w . ja va2 s .co m*/
$a1=array("a"=>"red","b"=>"green","c"=>"blue","d"=>"yellow");
$result=array_flip($a1);
print_r($result);
?>
The code above generates the following result.