I am using Bing Maps API to Geocode addresses. I took out an example from this page https://msdn.microsoft.com/en-us/library/ff817004.aspx which was form based process, in which you have to submit the address to get longitude and latitude. Now the requirement in front of me is that, I would like to manually put addresses in PHP page and get longitude and latitude. It is not happening. This is what we have tried as of now:
$key=key;
$baseURL = "http://dev.virtualearth.net/REST/v1/Locations";
$query ="Rajalakshmi Mill Road, Singanallur";
$findURL = $baseURL."/".$query."?output=xml&key=Aukd2ilaNJexSjdSjdkoGr26cpoqaVUhOg0MbDTZtfPGClozardCt_1iRscSm5Xo";
$output = file_get_contents($findURL);
$response = new SimpleXMLElement($output);
// Extract and pring latitude and longitude coordinates from results
$latitude = $response->ResourceSets->ResourceSet->Resources->Location->Point->Latitude;
$longitude = $response->ResourceSets->ResourceSet->Resources->Location->Point->Longitude;
$longitude = $response->ResourceSets->ResourceSet->Resources->Location->Point->Longitude;
$address = $response->ResourceSets->ResourceSet->Resources->Location->Address->FormattedAddress->State;
echo "Latitude: ".$latitude."<br>";
echo "Longitude: ".$longitude."<br>";
echo $address1;
What shall I do?