 <?php
    $array = array(0 => 'blue', 1 => 'red', 2 => 'green', 3 => 'red');
     
    $key = array_search('green', $array); // $key = 2;
    echo $key;
	$key = array_search('red', $array);   // $key = 1;
	echo $key;
	
	 $arraybis = array("toto" => 'blue', "titi" => 'red', "lulu" => 'green', "plouf" => 'red');
     
    $key = array_search('toto', $arraybis); // $key = 2;
    echo $key;
	$key = array_search('lulu', $arraybis);   // $key = 1;
	echo $key;
	
	//if (array_key_exists('premier', $search_array)) {
	//echo "L'élément 'premier' existe dans le tableau";
	//}
	
?>