在php使用curl時必須先在php.ini中開啟extension=php_curl.dll前面的;去了才行,curl是php中一款內建的瀏覽器,它可以模仿使用者瀏覽資訊進行網站瀏覽,等下面來看一實例,程式碼如下:
function postpage($url)
{
$response = "";
$rd=rand,44); .27.253:808';
if($rd==2) $proxy='http://222.77.14.56:8088';
if($rd==3) $proproxy .123.126:8080';
if($rd==4) $proxy='http://60.14.97.38:8080';
if($url != ""))> $url); curl_setopt($ch, curlopt_header, 0); curl_setopt($ch, curlop)_returntransfer, true); $response = curl_exec($ch ); if(curl_errno($ch)) $response = ""; curl_close($ch); }部份函數,如下所示: curl_close — close a curl session curl_copy_handle — copy a curl handle along with all number curl_error — return a string containing the last error for the current session curl_exec — perform a curl session curl_getinfo — get information regarding a specific transfer curl_init — initialize hand curl_init¢ normal curl handle to a curl multi handle curl_multi_close — close a set of curl handles run the sub-connections of the current curl handle curl_multi_getcontent — return the content of a curl hand information about the current transfers curl_multi_init — returns a new curl multi handle curl_multi_remove/ulti a multi handle from a set of curl handles curl_multi_select — wait for activity on any for a curl transfer curl_setopt — set an option for a curl transfer curl_version — getscurl curl_version — getscurl