Question
What will be the output of the following PHP code?
< ?php
$fruits = array ("mango", "apple", "pear", "peach");
$fruits = array_flip($fruits);
echo ($fruits[0]);
?>
< ?php
$fruits = array ("mango", "apple", "pear", "peach");
$fruits = array_flip($fruits);
echo ($fruits[0]);
?>
Answer: Option B
Was this answer helpful ?
As we are flipping the values, $fruits["mango"] = 0, $fruits["apple"] = 1 and so on.
Was this answer helpful ?
Submit Solution