Question
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) );
?>
< ?php
$state = array ("Karnataka", "Goa", "Tamil Nadu",
"Andhra Pradesh");
echo (array_search ("Tamil Nadu", $state) );
?>
Answer: Option D
Was this answer helpful ?
The array_search() function searches an array for a specified value, returning its key if located and FALSE otherwise.
Was this answer helpful ?
Submit Solution