array_search() is a inbuilt function of PHP which is used to search a particular value in an array and if the value is found then it returns its corresponding its key.

BY Best Interview Question ON 13 Jan 2019

Example

$array = array("1"=>"My", "2"=>"Name", "3"=>"is", "4"=>"BestInterviewQuestion");
echo array_search("BestInterviewQuestion",$array);

// OUTPUT 4