Created
November 23, 2016 14:03
-
-
Save emanh1/93b0777f4e2ef410cbb7a6dc2c5b9848 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function curl($url) { | |
| $ch = @curl_init(); | |
| curl_setopt($ch, CURLOPT_URL, $url); | |
| $head[] = "Connection: keep-alive"; | |
| $head[] = "Keep-Alive: 300"; | |
| $head[] = "Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7"; | |
| $head[] = "Accept-Language: en-us,en;q=0.5"; | |
| curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/37.0.2062.124 Safari/537.36'); | |
| curl_setopt($ch, CURLOPT_HTTPHEADER, $head); | |
| curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); | |
| curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); | |
| curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); | |
| curl_setopt($ch, CURLOPT_TIMEOUT, 60); | |
| curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 60); | |
| curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); | |
| curl_setopt($ch, CURLOPT_HTTPHEADER, array('Expect:')); | |
| $page = curl_exec($ch); | |
| curl_close($ch); | |
| return $page; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment