📅  最后修改于: 2022-03-11 14:53:54.434000             🧑  作者: Mango
$array = array(0 => 'blue', 1 => 'red', 2 => 'green', 3 => 'red');
$key = array_search('green', $array); // $key = 2;
$key = array_search('red', $array); // $key = 1;