Advertisement
Guest User

Untitled

a guest
May 28th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. function curl($url, $timeout = 5){
  2. $ci = curl_init();
  3. curl_setopt($ci, CURLOPT_URL, $url);
  4. curl_setopt($ci, CURLOPT_HEADER, 0);
  5. curl_setopt($ci, CURLOPT_RETURNTRANSFER, true);
  6. curl_setopt($ci, CURLOPT_FOLLOWLOCATION, true);
  7. curl_setopt($ci, CURLOPT_TIMEOUT, $timeout);
  8. curl_setopt($ci, CURLOPT_HTTPHEADER, array("Cache-Control: no-cache", "Pragma: no-cache"));
  9. curl_setopt($ci, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1");
  10. $r = curl_exec($ci);
  11. curl_close($ci);
  12.  
  13. return $r;
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement