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
$state = array (“Karnataka”, “Goa”, “Tamil Nadu”,
“Andhra Pradesh”);
echo (array_search (“Tamil Nadu”, $state) );
?>

What will be the output of the following PHP code?
<?php
$state = array (“Karnataka”, “Goa”, “Tamil Nadu”,
“Andhra Pradesh”);
echo (array_search (“Tamil Nadu”, $state) );
?>
a) True
b) 1
c) False
d) 2

Answer: d
Explanation: The array_search() function searches an array for a specified value, returning its key if located and FALSE otherwise.

Join The Discussion