地址:likew.pw/robot/robot.zip
快下载吧。。。。。
其内容格式为:#问题#[回答]
怎么用?看例子:
$q="无道";
$ff=file_get_contents("robot.txt");
preg_match_all('/#.*('.$q.').*\#\[(.*?)\]/i',$ff,$r);
$ni=count($r[0])-1;
if($ni<=0){
$text="机器人无法回答。请稍候再发。";
}else{
$i=rand(0,$ni);
$tt=explode('[',$r[0][$i]);
$rr=str_replace(array("]","#"),"",$tt[1]);
$text=$rr;
}
echo $text;当然,你也可以直接使用我的接口:
http://likew.pw/robot/api.php?msg=内容&key=19990304