Skip to content

Instantly share code, notes, and snippets.

@kathangeorg
Created May 15, 2012 07:47
Show Gist options
  • Save kathangeorg/2699813 to your computer and use it in GitHub Desktop.
Save kathangeorg/2699813 to your computer and use it in GitHub Desktop.
Google Maps CURL
function fetchURL($url) {
//$dateien = file ('http://www.example.com/');
//return implode("",$dateien);
//Initialize the Curl session
$ch = curl_init();
//Set curl to return the data instead of printing it to the browser.
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
//Set the URL
curl_setopt($ch, CURLOPT_URL, $url);
//Execute the fetch
$data = curl_exec($ch);
//Close the connection
curl_close($ch);
return $data;
// return @file_get_contents($url);
//$fileID = @fopen($url, 'rb', $willUseIncludePath = false);
//if ($fileID)
//{
// $contents = @fread($fileID, filesize($filePath));
// @fclose($fileID);
// }
//return $contents;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment