"Jaguar", "L" => "Land Rover", "A" => "Audi", "M" => "Maseratti");echo array_search("Maseratti","> What will be the output of the following PHP code ?<?php$Car

Home » PHP » PHP Sorting Arrays » Question
  1. What will be the output of the following PHP code ?
    <?php
    $Car = array("J" => "Jaguar", "L" => "Land Rover", "A" => "Audi", "M" => "Maseratti");
    echo array_search("Maseratti", $Car);
    ?>
    1. J
    2. L
    3. A
    4. M
    5. None of these
Correct Option: D

The array_search() function searches for the element and returns the key of that element.



Your comments will be displayed only after manual approval.