I am using this code for finding the lat lon of a location
$api='http://maps.googleapis.com/maps/api/geocode/json?address=United States Neversink&sensor=false';
$result = file_get_contents($api);
$data = json_decode($result);
But it give the warning Warning: file_get_contents(http://maps.googleapis.com/maps/api/geocode/json?address=United States Neversink&sensor=false) [function.file-get-contents]: failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request in C:\wamp\www\new_yellowpages\modules\mod_yellowpages_item_map\helper.php on line 139
if anyone know about this problem help me please.
Use curl instead of
file_get_contents: