<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
<? function split_en_str($str,$distinct=true) { //oSPHP.COM.CN
preg_match_all('/([a-zA-Z]+)/',$str,$match);
if ($distinct == true) {
$match[1] = array_unique($match[1]);
//
}
sort($match[1]);
return $match[1];
}
?>
本文介绍了一种使用PHP处理字符串的有效方法,特别是如何从字符串中提取英文单词并去除重复项。通过实际代码示例展示了如何利用正则表达式和数组操作来实现这一功能。
1万+

被折叠的 条评论
为什么被折叠?



