function re( $keyword ){
if ( $keyword<>'' ){
$header = array();
$header[]= 'Accept: image/gif, image/x-xbitmap, image/jpeg, image/pjpeg, application/x-shockwave-flash, text/html, * '. '/* ';
$header[]= 'Accept-Language: zh-cn ';
$header[]= 'User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:13.0) Gecko/20100101 Firefox/13.0.1';
$header[]= 'Host:
www.simsimi.com';
$header[]= 'Connection: Keep-Alive ';
$header[]= 'Cookie: JSESSIONID=2D96E7F39FBAB9B28314607D0328D35F';
$Ref="
http://www.simsimi.com/talk.htm?lc=ch";
$Ch = curl_init();
$Options = array(
CURLOPT_HTTPHEADER => $header,
CURLOPT_URL => '
http://www.simsimi.com/func/req?msg='.$keyword.'&lc=ch',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_REFERER => $Ref,
);
curl_setopt_array($Ch, $Options);
$Message = json_decode(curl_exec($Ch),true);
curl_close($Ch);
if($Message['result']=='100' && $Message['response'] <> 'hi'){
return $Message['response'];
}else{
return '服务器异常,请联系管理员';
}
}
}