fork download
  1. <?php
  2.  
  3. error_reporting(E_ALL);
  4. $url = "example.com";
  5. $ch = curl_init($url);
  6. curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.1; en; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13');
  7. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  8. curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 60);
  9. $header = array(
  10. 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
  11. 'Accept-Charset: ISO-8859-1,utf-8;q=0.7,*;q=0.7',
  12. 'Accept-Language: ru-RU, ru;q=0.8,en-US;q=0.6, en; q=0.4'
  13. );
  14. curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
  15.  
  16. curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
  17.  
  18. $data = curl_exec($ch);
  19. curl_close($ch);
  20.  
  21. echo $data;
Success #stdin #stdout 0.02s 33744KB
stdin
Standard input is empty
stdout
Standard output is empty