//返回字符串中的所有单词 $distinct=true 去除重复
<?
function split_en_str($str,$distinct=true) {
preg_match_all('/([a-zA-Z]+)/',$str,$match);
//开源代码OSPHP.COM.Cn
if ($distinct == true) {
$match[1] = array_unique($match[1]);
}
sort($match[1]); //OSPHP.COm.CN
return $match[1];
}
?>
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn