作者:zccst
官方网址:http://blog.s135.com/httpcws_v100/
一、下载分词软件
下载地址(32位版):http://httpcws.googlecode.com/files/httpcws-1.0.0-i386-bin.tar.gz
下载地址(64位版):http://httpcws.googlecode.com/files/httpcws-1.0.0-x86_64-bin.tar.gz
二、php使用curl调用
示例:
官方网址:http://blog.s135.com/httpcws_v100/
一、下载分词软件
下载地址(32位版):http://httpcws.googlecode.com/files/httpcws-1.0.0-i386-bin.tar.gz
下载地址(64位版):http://httpcws.googlecode.com/files/httpcws-1.0.0-x86_64-bin.tar.gz
二、php使用curl调用
示例:
<?php
$text = $_POST["text"];
if ($text != ""){
?>
<?php
$stime=microtime(true);
if (strlen($text) <= 20480){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://127.0.0.1:1985") ;
curl_setopt($ch, CURLOPT_POSTFIELDS, urlencode($text)) ;
$result = curl_exec($ch);
curl_close($ch);
} else {
echo "为防止恶意攻击,文字内容大小限制在了20KB以内。";
}
$etime=microtime(true);
$total=$etime-$stime;
?>
<?php
}
?>