"> What will be the output of the following PHP code?<?php$Name

Home » PHP » PHP Sorting Arrays » Question
  1. What will be the output of the following PHP code?
    <?php
    $Name = array ("Neha", "Ajit", "Rahul", "Ats");
    $Name = array_flip($Name);
    echo ($Name[0]);
    ?>
    1. Error
    2. Nothing
    3. Neha
    4. Rahul
    5. None of these
Correct Option: A

As we are flipping the values, $Name [“Neha”] = 0, $Name [“Ajit”] = 1 and so on.



Your comments will be displayed only after manual approval.