复制代码代码如下所示:
< PHP
功能vcurl($url,$ POST = ',$ COOKIE =,=cookiejar美元,$ referer =){
tmpinfo美元=;
cookiepath美元= getcwd函数()。'。cookiejar美元;
美元curl_init卷曲=();
curl_setopt(合卷,curlopt_url,$ URL);
curl_setopt(合卷,curlopt_useragent,_server美元{ 'http_user_agent});
如果($ referer){
curl_setopt(合卷,curlopt_referer,为参考);
{人}
curl_setopt(合卷,curlopt_autoreferer,1);
}
如果($ POST){
curl_setopt(合卷,curlopt_post,1);
curl_setopt(合卷,curlopt_postfields,$ POST);
}
如果($ cookie){
curl_setopt(合卷,curlopt_cookie,$ COOKIE);
}
如果($ cookiejar){
curl_setopt(合卷,curlopt_cookiejar,cookiepath美元);
curl_setopt(合卷,curlopt_cookiefile,cookiepath美元);
}
/ / curl_setopt(合卷,curlopt_followlocation,1);
curl_setopt(合卷,curlopt_timeout,100);
curl_setopt(合卷,curlopt_header,0);
curl_setopt(合卷,curlopt_returntransfer,1);
tmpinfo美元= curl_exec(合卷);
如果(curl_errno(合卷)){
回声的错误:curl_error(合卷);
}
curl_close(合卷);
返回的tmpinfo;
}
>