[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;
 $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
 $response = json_decode($data);
 return $response;


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.