file_get_contents() alternative?
Posted: Mon Feb 09, 2009 9:38 pm
Here's my code:
Basically, I use file_get_contents() to read the results sent back from google to get the latitude and longitude for a location.
Problem is, some of my clients do not have file_get_contents() enabled. Is there a php 4 + php 5 safe way to read the results without using a function that is going to be disabled by some of the bigger hosting companies?
Code: Select all
$url = "http://maps.google.com/maps/geo?q=$mapaddress&output=xml&key=$key";
$page = file_get_contents($url);
preg_match_all('#<coordinates>(.*?),(.*?),(.*?)</coordinates>#s', $page, $matches);Problem is, some of my clients do not have file_get_contents() enabled. Is there a php 4 + php 5 safe way to read the results without using a function that is going to be disabled by some of the bigger hosting companies?