difference between array_search() and in_array() in php

difference between array_search() and in_array() in php


in_array() checks if the specified value exits in the array,whilearray_search() searches an array for a given value and returns the key
example of in_array():
<?
$a1=array("a"=>"one","b"=>"two");
if(in_array("one",$a1))
{
echo "exit";
}else
{
echo "not exist";
}
//example of array_search():
 $a1=array("a"=>"one","b"=>"two");
echo array_search("one",$a1);
it returns: a
?>