[CODE] function to get google place recommandations


function fetch_google_venue_recommandation($place_name,$long,$lat){
 global $logger;
 $url = "https://maps.googleapis.com/maps/api/place/textsearch/json?query=" . $place_name . "&sensor=true&location=".$long.",".$lat. "&key=" . GOOGLE_APP_KEY;
 $places = null;
 $logger->debug($url);
 $ch = curl_init($url);
 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
 curl_setopt($ch, CURLOPT_HEADER, 0);
 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
 $data = curl_exec($ch); // Yelp response
 curl_close($ch);
 $response = json_decode($data);
 return $response;
 }

Advertisements