Snippet

  1. // get contents via curl
  2. function curl_get($url){
  3.    $browser_agent = "Firefox";
  4.    $ch=curl_init();
  5.    curl_setopt($ch,CURLOPT_URL,$url);
  6.    curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
  7.    curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,false);
  8.    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);              
  9.    curl_setopt($ch,CURLOPT_FOLLOWLOCATION,1);
  10.    curl_setopt($ch,CURLOPT_USERAGENT, $browser_agent);
  11.    $result=curl_exec($ch);
  12.    curl_close($ch);
  13.  return$result;
  14. }