$params = array(
"post"=>false, //POST
"postData"=>false, //POST-данные
"referer"=>"", //referer
"headers"=>array(
":authority: www.avito.ru",
":method: GET",
"upgrade-insecure-requests: 1",
"user-agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.54 Safari/537.36",
), //CURLOPT_HEADER
"nobody"=>false, //CURLOPT_NOBODY
"timeout"=>30, //CURLOPT_TIMEOUT
"contimeout"=>30, //CURLOPT_CONNECTTIMEOUT
"returntransfer"=>true, //CURLOPT_RETURNTRANSFER
"sslVer"=>false, //CURLOPT_SSL_VERIFYPEER
"images"=>false, //images
"followlocation"=>true, //CURLOPT_FOLLOWLOCATION
"proxy"=>"мои прокси", //CURLOPT_FOLLOWLOCATION
"userAgent"=>"Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/95.0.4638.54 Safari/537.36" //CURLOPT_USERAGENT
);
$s = curl_init();
curl_setopt($s,CURLOPT_URL,$this->page);
if($this->headers){
curl_setopt($s, CURLOPT_HTTPHEADER, $this->headers);
//curl_setopt($s,CURLOPT_HEADER,true);
}
curl_setopt($s, CURLOPT_NOBODY, $this->nobody);
curl_setopt($s,CURLOPT_TIMEOUT,$this->timeout);
curl_setopt($s,CURLOPT_RETURNTRANSFER,$this->returntransfer);
curl_setopt($s,CURLOPT_FOLLOWLOCATION,$this->followlocation);
if($cookie){
curl_setopt($s, CURLOPT_COOKIESESSION, 1);
curl_setopt($s,CURLOPT_COOKIEJAR,$this->cookie);
curl_setopt($s,CURLOPT_COOKIEFILE,$this->cookie);
}
curl_setopt($s, CURLOPT_SSL_VERIFYPEER, $this->sslVer);
curl_setopt($s,CURLOPT_USERAGENT,$this->userAgent);
curl_setopt($s,CURLOPT_REFERER,$this->referer);
if($this->proxy){
$proxy = explode(':',$this->proxy);
curl_setopt ($s, CURLOPT_PROXY, $proxy[0].':'.$proxy[1]);
if(isset($proxy[2]) && isset($proxy[3]))
curl_setopt($s, CURLOPT_PROXYUSERPWD, $proxy[2].':'.$proxy[3]);
}
if($put_images && $put_images[0] && $put_images[1]){
$temp = fopen($put_images[1], 'w');
curl_setopt($s, CURLOPT_FILE, $temp);
}
if($this->post)
{
curl_setopt($s,CURLOPT_POST,true);
curl_setopt($s,CURLOPT_POSTFIELDS,$this->postData);
}
$this->webpage = curl_exec($s);
$this->status = curl_getinfo($s,CURLINFO_HTTP_CODE);
curl_close($s);