返回字符串中的所有单词
span style=font-family:Courier New, Courier, monospace;line-height:21px;font-size:14px;color:#333333;返回字符串中的所有单词 $distinct=true 去除重复/span
返回字符串中的所有单词 $distinct=true 去除重复
//返回字符串中的所有单词 $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];
}
?>
- 上一篇:将HTML表格的每行每列转为数组,采集表格数据
- 下一篇:PHP获取汉字拼音首字母
精彩图集
精彩文章






