I want to get the distance from one point to another using the google API, but I'm having some issues.
My API link is:
http://maps.googleapis.com/maps/api/directions/json?origin=55.061744,9.429565&destination=Opnæsgård,%20Hørsholm,%20Denmark&alternatives=true&sensor=false
If I access this link from the browser, I get the correct distance however; when I try to access the exact same URL from my php script, I get an error.
My php script:
<?php
print_r(file_get_contents('http://maps.googleapis.com/maps/api/directions/json?origin=55.061744,9.429565&destination=Opnæsgård,%20Hørsholm,%20Denmark&alternatives=true&sensor=false'));
?>
Output from php script:
{ "routes" : [], "status" : "NOT_FOUND" }
As you can see, I'm getting two different results with the same URL, and I have no idea why.
I have also tried using CURL in the php script without any luck.
I hope you can help me
//Mikkel