Created
September 24, 2012 06:43
-
-
Save faraz046/3774646 to your computer and use it in GitHub Desktop.
curl file get contents functions
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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