ch = curl_init(); curl_setopt($this->ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($this->ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($this->ch, CURLOPT_ENCODING, "gzip"); curl_setopt($this->ch, CURLOPT_SSL_VERIFYHOST, 0); curl_setopt($this->ch, CURLOPT_SSL_VERIFYPEER, 0); curl_setopt($this->ch, CURLOPT_USERAGENT, 'User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36'); curl_setopt($this->ch, CURLOPT_COOKIEFILE, 'cookie.txt'); curl_setopt($this->ch, CURLOPT_COOKIEJAR, 'cookie.txt'); curl_setopt($this->ch, CURLOPT_HTTPHEADER, array( 'ACCEPT_LANGUAGE: ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7', 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3', 'Upgrade-Insecure-Requests: 1', 'cache-control: private', 'content-length: 0', 'content-type: text/xml; charset=utf-8', 'date: Tue, 09 Apr 2019 05:44:31 GMT', 'p3p: CP="NON UNI COM NAV STA LOC CURa DEVa PSAa PSDa OUR IND"', 'status: 200', 'strict-transport-security: max-age=31536000; includeSubDomains; preload', 'vary: Accept-Encoding', )); } public function fetch_url($u) { curl_setopt($this->ch, CURLOPT_URL, $u); curl_setopt($this->ch, CURLOPT_POST, 0); return curl_exec($this->ch); } public function __destruct() { curl_close($this->ch); } }