?
What will be the output of the following PHP code ?
What will be the output of the following PHP code ?
<?php
$a1 = array("a" => "red", "b" => "green", "c" => "blue", "d" => "yellow");
$result = array_flip($a1);
print_r($result);
?>
<?php
$a1 = array("a" => "red", "b" => "green", "c" => "blue", "d" => "yellow");
$result = array_flip($a1);
print_r($result);
?>
Answer & Solution
Correct Answer:
Option
C
The array_flip() function flips/exchanges all keys with their associated values in an array.
Join the Discussion
Login to post a comment or share your explanation.
Login