?
What will be the output of the following PHP code ?
What will be the output of the following PHP code ?
<?php
$a = array("a" => "Jaguar", "b" => "Land Rover", "c" => "Audi", "d" => "Maseratti");
echo array_search("Audi", $a);
?>
<?php
$a = array("a" => "Jaguar", "b" => "Land Rover", "c" => "Audi", "d" => "Maseratti");
echo array_search("Audi", $a);
?>
Answer & Solution
Correct Answer:
Option
C
The array_search() function searches for the element and returns the key of that element.
Join the Discussion
Login to post a comment or share your explanation.
Login