I am trying reverse geocode using google api in php script(using xmlrpc).I wrote the following code in my local system its works fine,but when I try in our webserver it fails.
function reverseGeoCode()
{
$url = "http://maps.google.com/maps/geo?json&ll=".$lat.",".$long;
$data = file_get_contents(urlencode($url));
if ($data == FALSE)
{
echo "failed";
}
else
{
echo "success";
// parsing the json/xml ...
}
}
I got the o/p "failed"
my local php: php5.3.6 and webser is 5.2.9. Since it continously failed i change the url to http://www.google.com for testing(with out using urlencode),then also it failed in webserver.If any one have idea to retify my error Please help.Thanks in advance