PHP MCQ Arrays in PHP MCQ Question #2381
Single Choice Not Set

QWhat will be the output of the following PHP code?
< ?php 
    $fruits = array ("mango", "apple", "pear", "peach");
    $fruits = array_flip($fruits);
    echo ($fruits[0]);
?>

ID: #2381 Arrays in PHP MCQ 1,002 views
Question Info
#2381Q ID
Not SetDifficulty
Arrays in PHP MCQTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A mango
  • B Error
  • C peach
Correct Answer

Explanation

As we are flipping the values, $fruits["mango"] = 0, $fruits["apple"] = 1 and so on.

Share This Question

Challenge a friend or share with your study group.