Skip to content

Instantly share code, notes, and snippets.

@nivekmai
Created March 26, 2014 00:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nivekmai/9774337 to your computer and use it in GitHub Desktop.
Save nivekmai/9774337 to your computer and use it in GitHub Desktop.
function fetch_html ($url){
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_USERPWD, ZDUSER."/token:".ZDAPIKEY);
curl_setopt($ch, CURLOPT_USERAGENT, "Lynx/2.8.8dev.3 libwww-FM/2.14 SSL-MM/1.4.1");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_VERBOSE, TRUE);
$webpage = curl_exec($ch);
curl_close($ch);
return $webpage;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment