Google Maps API to calculate location distance in PHP

This example shows how to use the Google maps API to calculate distance between two places in PHP $result = file_get_contents(’http://maps.googleapis.com/maps/api/directions/json?origin=Chicago,IL&destination=Raleigh,NC&sensor=false’); $result = json_decode($results); $distance = $result->routes->legs->distance[’text’]; echo $distance // Outputs: "xxx mi"
Continue reading…

Enjoyed this post? Share it!

 
 

Making REST requests from PHP

The most simplest way is to use $data = json_decode( file_get_contents(“http://www.w3mentor.com/service.json”) ); This example won’t work on servers that explicitly disable the URL opening behavior, mostly seen in cialis 30 day free trialtadalafil citrateviagra causes cancerreviews of online pharmacybuy brand viagra online shared hosting environment.
Continue reading…

Enjoyed this post? Share it!