Skip to content

Instantly share code, notes, and snippets.

@faraz046
Created September 24, 2012 06:43
Show Gist options
  • Save faraz046/3774646 to your computer and use it in GitHub Desktop.
Save faraz046/3774646 to your computer and use it in GitHub Desktop.
curl file get contents functions
function curl_get_file_contents($URL) {
$c = curl_init();
curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($c, CURLOPT_URL, $URL);
$contents = curl_exec($c);
$err = curl_getinfo($c,CURLINFO_HTTP_CODE);
curl_close($c);
if ($contents) return $contents;
else return FALSE;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment