|
发表于 2017-2-13 11:53:14
|
显示全部楼层
- function ffxia_split($keywords='',$num=4)
- {
- $ks = [];
- $keyarr = preg_split('#[ ;:\[\]]#uis', $keywords,0,PREG_SPLIT_NO_EMPTY);
- if(count($keyarr)==1)
- {
- $temp = preg_replace('#[/\().,,。、&|;]#uis','', $keywords);
- if(!$temp) return $ks;
- $keyarr = get_tags($keywords);
- }
- foreach ($keyarr as $key => $val)
- {
- $temp = preg_replace('#[/\().,,。、&|;]#uis','', $val);
- if($temp) $ks[$key] = $temp;
- }
- return array_slice($ks,0,$num);
- }
复制代码
把这段代码加到 Core\Common\Common\ext_function.php
试试效果怎么样
|
本帖子中包含更多资源
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
|