日期:2014-05-17 浏览次数:20534 次
function QQLite_get($msg, $type='jm') {您搜索的解梦关键词:老虎
$url = 'http://api.94qing.com';
$cookiejar = realpath('cookie.txt');
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_TIMEOUT, 5);
curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']);
curl_setopt($ch, CURLOPT_REFERER, $url);
curl_setopt($ch, CURLOPT_COOKIEJAR, $cookiejar);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
$r = curl_exec($ch);
curl_setopt($ch, CURLOPT_URL, "$url?type=$type&msg=$msg");
curl_setopt($ch, CURLOPT_COOKIEFILE, $cookiejar);
$r = curl_exec($ch);
curl_close($ch);
return $r;
}
echo QQLite_get('老虎'); //中文要 utf-8 编码的
echo QQLite_get('大象');