Skip to content

Instantly share code, notes, and snippets.

@BugBuster1701
Created November 20, 2013 21:11
Show Gist options
  • Save BugBuster1701/7571132 to your computer and use it in GitHub Desktop.
Save BugBuster1701/7571132 to your computer and use it in GitHub Desktop.
alternative to file_get_contents when allow_url_fopen is disabled
function url_get_contents ($Url) {
if (!function_exists('curl_init')){
die('CURL is not installed!');
}
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $Url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$output = curl_exec($ch);
curl_close($ch);
return $output;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment