效果不怎么好,效率和速度较差,仅仅记录分享。
修改路径phpcmslibsfunctionsextention.func.php
//分词 function httppost($title){ $ch = curl_init(); $options = array( CURLOPT_URL => 'http://api.pullword.com/get.php?source='.$title.'¶m1=0¶m2=0', CURLOPT_HEADER => 0, //不看头部 CURLOPT_RETURNTRANSFER => true, //返回响应内容 CURLOPT_FOLLOWLOCATION => false, //支持重定向 CURLOPT_SSL_VERIFYPEER => false, //设置不用服务器端证书验证 ); curl_setopt_array($ch, $options); $result = curl_exec($ch); curl_close($ch); return $result; }
修改模版show.html调用
<strong>分词测试:</strong>{$httppost($title)}