/** * 分词 * * @param [type] $str * @return void * str 例如:str 清华大学是好学校 * percentage 例如:0 拉取所有词,1 拉取词的概率为100%。 * debug 例如:0 关闭调试 1 开启调试 * @author 617 <email:723875993@qq.com> */ if (!function_exists('getStrSplit')) { function getStrSplit($str, $percentage = 0.9, $debug = 0) { $url = "http://api.pullword.com/get.php?source=$str¶m1=$percentage¶m2=$debug"; $result = file_get_contents_curl($url); if ($result === 'error') return ''; $result = explode("\n", $result); return filter_array($result); } }