<?php $arr_a = array(0 => "a", 1 => "b", 2 => "c"); $key = array_search("a", $arr_a); if( $key !== FALSE ){ echo "键名为:$key"; } else { echo '无匹配结果'; } ?>