📅  最后修改于: 2022-03-11 14:54:44.094000             🧑  作者: 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;