$str = "abc123d45ef6g7"; $n = preg_match_all('/[a-zA-Z]*/', $str, $matches); if ($n) { echo implode("", $matches[0]); } ?> 复制代码 附: 取出全部的字母 echo preg_replace('/[^a-z]/i', '', $str1); 只取前边的字母 echo preg_replace('/^([a-z]+).*/i', '$1', $str1);