-
What will be the output of the following PHP code ?
<?php
$Color = array("R" => "Red", "G" => "Green", "B" => "Blue", "Y" => "Yellow");
$Result = array_flip($Color);
print_r($Result);
?>
-
-
Array
(
[Red] => R
[Green] => G
[Blue] => B
[Yellow] => Y
) - Error
-
Array
(
[Red] => R
[Green] => G
) - Nothing
- None of these
-
Correct Option: A
The array_flip() function flips/exchanges all keys with their associated values in an array.