$str = "好好学习,天天向上!good good study,day day up! hello,world!你好世界!~";
function getWords($str){
preg_match_all("([a-zA-Z]*)", $str,$arr) ;
if(!empty($arr)){
foreach($arr[0] as $k=>$v){
if(!empty($v)){
$words[]=$v;
}
}
return $words;
}
return '';
}
$str_en = getWords($str);
print_r($str_en);die;
网友评论