Created
May 15, 2012 07:47
-
-
Save kathangeorg/2699813 to your computer and use it in GitHub Desktop.
Google Maps CURL
This file contains hidden or 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 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