Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

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);
?>

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);
?>
a) a
b) b
c) c
d) d

Answer: c
Explanation: The array_search() function searches for the element and returns the key of that element.

Join The Discussion