CURL 远程请求调用

function curl_file_get_contents($url) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_TIMEOUT, 5); curl_setopt($ch, CURLOPT_USERAGENT, '_USERAGENT_'); curl_setopt($ch, CURLOPT_REFERER,'_REFERER_'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $r = curl_exec($ch); curl_close($ch); return $r; } 

你可能感兴趣的:(PHP技术)