ExamVeda
Login
Home
This question belongs to PHP Arrays
Arrays
?

What will be the output of the following PHP code?
<?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.
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.