Examveda
Examveda

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: Option D

Solution(By Examveda Team)

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

This Question Belongs to PHP >> Arrays

Join The Discussion

Related Questions on Arrays