?
What will be the output of the following PHP code?
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 & Solution
Correct Answer:
Option
B
As we are flipping the values, $fruits[“mango”] = 0, $fruits[“apple”] = 1 and so on.
Join the Discussion
Login to post a comment or share your explanation.
Login