{"id":15224,"date":"2016-11-14T16:15:46","date_gmt":"2016-11-14T14:15:46","guid":{"rendered":"http:\/\/www.webcodegeeks.com\/?p=15224"},"modified":"2018-01-09T10:07:15","modified_gmt":"2018-01-09T08:07:15","slug":"php-google-geocode-example","status":"publish","type":"post","link":"https:\/\/www.webcodegeeks.com\/php\/php-google-geocode-example\/","title":{"rendered":"PHP Google Geocode Example"},"content":{"rendered":"<p>In this example we will explain Google Map Geocoding, what it means and how we can manipulate the Google Map Geocoding API. For this example we will need:<\/p>\n<ul>\n<li>A computer with PHP &gt;= 5.5 installed<\/li>\n<li>notepad++<\/li>\n<\/ul>\n<h2>1. Getting Started<\/h2>\n<p>Lets start by defining Google Map.<br \/>\n&nbsp;<br \/>\n&nbsp;<br \/>\n[ulp id=&#8217;8njY7i2QRy6sg8pg&#8217;]<br \/>\n&nbsp;<br \/>\nAccording to wikipedia, Google Maps is a web mapping service developed by Google . It offers satellite imagery, street maps , 360\u00b0 panoramic views of streets (Street View), real-time traffic conditions (Google Traffic), and route planning for traveling by foot, car, bicycle (in beta), or public transportation.<\/p>\n<p>Another good but simpler definition below.<\/p>\n<p>Google map is a web based mapping service that provides access to up-to-date data or information about cities,states countries, continents or regions world wide. Simply put google maps allows us access different geographic data. Google Map provides access it its service through an API (Application Programming Interface).<br \/>\nWe can access this API in a number of ways:<\/p>\n<ul>\n<li>Google Maps Javascript API: This allows you to access google maps service through javascript and according to its website it features a robust support.<br \/>\nTo learn more about the Javascript API <a href=\"https:\/\/www.webcodegeeks.com\/php\/php-google-maps-example\/\">Visit this tutorial <\/a><\/li>\n<li>Google Maps embed API: You do not need any working knowledge of javascript to access Google Map in this way because you do not need to write any code. Just enter the neccessary location and copy the given code.<\/li>\n<li>Google Street View Image Api.<\/li>\n<li>Google Static Map Api: Embed a map image without JavaScript or dynamic page loading. With this method you embed a map image and you dont need javascript to do it.<\/li>\n<li>Google Places API Javascript Library: Up-to-date information about millions of locations.<\/li>\n<\/ul>\n<p>In this example we are going to develop web apps that use Google geocoding API.<\/p>\n<h3>1.1 Google Geocoding<\/h3>\n<p>According to Google, Geocoding is the process of converting addresses (like &#8220;1600 Amphitheatre Parkway, Mountain View, CA&#8221;) into geographic coordinates (like latitude 37.423021 and longitude -122.083739), which you can use to place markers on a map, or position the map. The reverse is also possible, it is called reverse Geocoding.<br \/>\nReverse geocoding is the process of converting geographic coordinates into a human-readable address. The Google Maps Geocoding API&#8217;s reverse geocoding service also lets you find the address for a given place ID. Place IDs uniquely identify a place in the Google Places database and on Google Maps.<\/p>\n<figure id=\"attachment_15246\" aria-describedby=\"caption-attachment-15246\" style=\"width: 860px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/11\/map3.jpg\"><img decoding=\"async\" class=\"wp-image-15246 size-full\" src=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/11\/map3.jpg\" alt=\"Google Map Example\" width=\"860\" height=\"484\" srcset=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/11\/map3.jpg 860w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/11\/map3-300x169.jpg 300w, https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/11\/map3-768x432.jpg 768w\" sizes=\"(max-width: 860px) 100vw, 860px\" \/><\/a><figcaption id=\"caption-attachment-15246\" class=\"wp-caption-text\">Google Map Example<\/figcaption><\/figure>\n<p><span style=\"text-decoration: underline;\"><em>index.html<\/em><\/span><\/p>\n<pre class=\"brush:html;wrap-lines:false;\">&lt;!DOCTYPE\u00a0html&gt;\r\n&lt;html lang=eng&gt;\r\n\t&lt;head&gt;\r\n\t&lt;style&gt;\r\n #map {\r\n\u00a0 \u00a0 \u00a0 \u00a0 height: 400px;\r\n\u00a0 \u00a0 \u00a0 \u00a0 width: 100%;\r\n\u00a0 \u00a0 \u00a0 \u00a0}\r\n\t&lt;\/style&gt;\r\n\r\n\t\t&lt;meta charset=\"utf-8\" \/&gt;\r\n\t\t&lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"\/&gt;\r\n&lt;!DOCTYPE\u00a0html&gt;\r\n&lt;html lang=eng&gt;\r\n\t&lt;head&gt;\r\n\t&lt;style&gt;\r\n #map {\r\n\u00a0 \u00a0 \u00a0 \u00a0 height: 400px;\r\n\u00a0 \u00a0 \u00a0 \u00a0 width: 100%;\r\n\u00a0 \u00a0 \u00a0 \u00a0}\r\n\t&lt;\/style&gt;\r\n\r\n\t\t&lt;meta charset=\"utf-8\" \/&gt;\r\n\t\t&lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"\/&gt;\r\n\r\n&lt;body&gt;\r\n&lt;h1&gt; Google Map Geocoding Example &lt;\/h1&gt;\r\n\r\n&lt;form method=post action=\"index.php\"&gt;\r\n&lt;select name=cali&gt;\r\n&lt;option value =\"1600+Amphitheatre+Parkway,+Mountain+View,+CA\"&gt;California&lt;\/option&gt;\r\n&lt;\/select&gt;\r\n&lt;input type=submit name=button value=submit&gt;\r\n&lt;\/form&gt;\r\n&lt;?php\r\n}\r\n?&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<p>The above html page contains a drop down list inside a form which has a single address. When the submit button is clicked, the form is submitted and the content of the Drop down list is transmitted to the server (to a script called index.php) .<\/p>\n<p><span style=\"text-decoration: underline;\"><em>index.php<\/em><\/span><\/p>\n<pre class=\"brush:php;highlight:[5,6,8,10,22,26,27,31];wrap-lines:false;\">&lt;?php\r\nif(isset($_POST[\"button\"])){\r\n\t$lati=null;\r\n\t$longi=null;\r\n$address = $_POST[\"cali\"];\r\n$address = urlencode($address);\/\/properly encode the url\r\n\/\/ google map geocode api url\r\n$url = \"http:\/\/maps.google.com\/maps\/api\/geocode\/json?address={$address}\";\/\/we are getting the response in json\r\n\/\/ get the json response\r\n$resp_json = file_get_contents($url);\r\n\/\/ decode the json\r\n$resp = json_decode($resp_json, true);\r\n\/\/the  response status would  be 'OK', if are able to geocode the given address \r\nif($resp['status']=='OK'){\r\n\/\/ get the longtitude and latitude data\r\n$lat = $resp['results'][0]['geometry']['location']['lat'];\r\n$long = $resp['results'][0]['geometry']['location']['lng'];\r\n?&gt;\r\n&lt;div id=map style=\"width:100%;height:500px\"&gt;\r\n\r\n&lt;\/div&gt;\r\n&lt;script  async defer\r\nsrc=\"http:\/\/maps.googleapis.com\/maps\/api\/js?key=YOUR_API_KEY&amp;callback=drawMap\"&gt;&lt;\/script&gt;\r\n&lt;script&gt;\r\n\u00a0 \u00a0 function drawMap() {\r\n\u00a0 \u00a0 \u00a0 \u00a0 var pos = {lat: &lt;?php echo $lat ?&gt; , lng:&lt;?php echo $long ?&gt;};\r\n\u00a0 \u00a0 \u00a0 \u00a0 var map = new google.maps.Map(document.getElementById('map'), {\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 zoom: 4,\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 center: pos\r\n\u00a0 \u00a0 \u00a0 \u00a0 });\r\n\u00a0 \u00a0 \u00a0 \u00a0 var marker = new google.maps.Marker({\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 position: pos,\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 map: map\r\n\u00a0 \u00a0 \u00a0 \u00a0 });\r\n\u00a0 \u00a0 \u00a0 }\r\n\r\n&lt;\/script&gt;\r\n&lt;?php\r\n}\r\n}\r\nelse{\r\n\techo \"DID NOT RECEIVE LATITUDE AND LONGITUDE DATA\";\r\n}\r\n?&gt;\r\n<\/pre>\n<p>In this script we process the content sent by the form (lines five and six) and call the geocoding API(lines eight to ten) and tell it to return the required data in json.<\/p>\n<pre class=\"brush:bash;wrap-lines:false;\">$url = \"http:\/\/maps.google.com\/maps\/api\/geocode\/json?address={$address}\"\r\n<\/pre>\n<p>In line 22 we load the google map API, in order to draw the map on a browser.<\/p>\n<pre class=\"brush:html;wrap-lines:false;\">&lt;script  async defer\r\nsrc=\"http:\/\/maps.googleapis.com\/maps\/api\/js?key=YOUR_API_KEY&amp;callback=drawMap\"&gt;&lt;\/script&amp;gt\r\n\r\n<\/pre>\n<p>The async attribute allows the browser to continue rendering the rest of your page while the API loads. We pass our API key and add a callback function. (The callback function is called after the script has loaded completely). \u00a0In this case the function name is drawMap.<br \/>\nIn line 26 we create an object which holds the coordinates of the region we want to be displayed. In line 27 we instatiate the map object. We pass our div tag, the zoom value and our coordinate object. In line 31 we create a marker object and pass our map to it. We have successfully used the google map geocoding API to draw a map.<\/p>\n<h2>2. Summary<\/h2>\n<p>In this example we learnt about Google Maps Geocoding API, how to use it to get the coordinates of a street or area and display on a map. We also learnt about the different ways we can access the Google Map service.<\/p>\n<h2>3. Download the source code<\/h2>\n<div class=\"download\"><strong>Download<\/strong><br \/>\nYou can download the full source code of this example here: <strong><strong><strong><a href=\"http:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2016\/11\/Phpgeocodingexample.zip\">phpgeocodingexample<\/a><\/strong><\/strong><\/strong><\/div>\n","protected":false},"excerpt":{"rendered":"<p>In this example we will explain Google Map Geocoding, what it means and how we can manipulate the Google Map Geocoding API. For this example we will need: A computer with PHP &gt;= 5.5 installed notepad++ 1. Getting Started Lets start by defining Google Map. &nbsp; &nbsp; [ulp id=&#8217;8njY7i2QRy6sg8pg&#8217;] &nbsp; According to wikipedia, Google Maps &hellip;<\/p>\n","protected":false},"author":164,"featured_media":930,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[],"class_list":["post-15224","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>PHP Google Geocode Example - Web Code Geeks - 2026<\/title>\n<meta name=\"description\" content=\"In this example we will explain Google Map Geocoding, what it means and how we can manipulate the Google Map Geocoding API. For this example we will need:\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.webcodegeeks.com\/php\/php-google-geocode-example\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"PHP Google Geocode Example - Web Code Geeks - 2026\" \/>\n<meta property=\"og:description\" content=\"In this example we will explain Google Map Geocoding, what it means and how we can manipulate the Google Map Geocoding API. For this example we will need:\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.webcodegeeks.com\/php\/php-google-geocode-example\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webcodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2016-11-14T14:15:46+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-01-09T08:07:15+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/php-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Olayemi Odunayo\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webcodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@webcodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Olayemi Odunayo\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.webcodegeeks.com\/php\/php-google-geocode-example\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/php\/php-google-geocode-example\/\"},\"author\":{\"name\":\"Olayemi Odunayo\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/417918d9b5811210265e8590509718b8\"},\"headline\":\"PHP Google Geocode Example\",\"datePublished\":\"2016-11-14T14:15:46+00:00\",\"dateModified\":\"2018-01-09T08:07:15+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/php\/php-google-geocode-example\/\"},\"wordCount\":678,\"commentCount\":3,\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/php\/php-google-geocode-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/php-logo.jpg\",\"articleSection\":[\"PHP\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.webcodegeeks.com\/php\/php-google-geocode-example\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.webcodegeeks.com\/php\/php-google-geocode-example\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/php\/php-google-geocode-example\/\",\"name\":\"PHP Google Geocode Example - Web Code Geeks - 2026\",\"isPartOf\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/php\/php-google-geocode-example\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/php\/php-google-geocode-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/php-logo.jpg\",\"datePublished\":\"2016-11-14T14:15:46+00:00\",\"dateModified\":\"2018-01-09T08:07:15+00:00\",\"description\":\"In this example we will explain Google Map Geocoding, what it means and how we can manipulate the Google Map Geocoding API. For this example we will need:\",\"breadcrumb\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/php\/php-google-geocode-example\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.webcodegeeks.com\/php\/php-google-geocode-example\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/php\/php-google-geocode-example\/#primaryimage\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/php-logo.jpg\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/php-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.webcodegeeks.com\/php\/php-google-geocode-example\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.webcodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"PHP\",\"item\":\"https:\/\/www.webcodegeeks.com\/category\/php\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"PHP Google Geocode Example\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#website\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"name\":\"Web Code Geeks\",\"description\":\"Web Developers Resource Center\",\"publisher\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.webcodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/www.webcodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webcodegeeks\",\"https:\/\/x.com\/webcodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/417918d9b5811210265e8590509718b8\",\"name\":\"Olayemi Odunayo\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/016b2a353262962fceecf5c274161cd9ef60fdf1593ec95e71d37f5fd9b444f6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/016b2a353262962fceecf5c274161cd9ef60fdf1593ec95e71d37f5fd9b444f6?s=96&d=mm&r=g\",\"caption\":\"Olayemi Odunayo\"},\"description\":\"I am a programmer and web developer, who has experience in developing websites and writing desktop and mobile applications. I have worked with both schematic and schemaless databases. I am also familiar with third party API and working with cloud servers. I do programming on the client side with Java, JavaScript, html, Ajax and CSS while I use PHP for server side programming.\",\"sameAs\":[\"https:\/\/www.webcodegeeks.com\/\"],\"url\":\"https:\/\/www.webcodegeeks.com\/author\/olayemi-odunayo\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"PHP Google Geocode Example - Web Code Geeks - 2026","description":"In this example we will explain Google Map Geocoding, what it means and how we can manipulate the Google Map Geocoding API. For this example we will need:","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.webcodegeeks.com\/php\/php-google-geocode-example\/","og_locale":"en_US","og_type":"article","og_title":"PHP Google Geocode Example - Web Code Geeks - 2026","og_description":"In this example we will explain Google Map Geocoding, what it means and how we can manipulate the Google Map Geocoding API. For this example we will need:","og_url":"https:\/\/www.webcodegeeks.com\/php\/php-google-geocode-example\/","og_site_name":"Web Code Geeks","article_publisher":"https:\/\/www.facebook.com\/webcodegeeks","article_published_time":"2016-11-14T14:15:46+00:00","article_modified_time":"2018-01-09T08:07:15+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/php-logo.jpg","type":"image\/jpeg"}],"author":"Olayemi Odunayo","twitter_card":"summary_large_image","twitter_creator":"@webcodegeeks","twitter_site":"@webcodegeeks","twitter_misc":{"Written by":"Olayemi Odunayo","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.webcodegeeks.com\/php\/php-google-geocode-example\/#article","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/php\/php-google-geocode-example\/"},"author":{"name":"Olayemi Odunayo","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/417918d9b5811210265e8590509718b8"},"headline":"PHP Google Geocode Example","datePublished":"2016-11-14T14:15:46+00:00","dateModified":"2018-01-09T08:07:15+00:00","mainEntityOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/php\/php-google-geocode-example\/"},"wordCount":678,"commentCount":3,"publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/php\/php-google-geocode-example\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/php-logo.jpg","articleSection":["PHP"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.webcodegeeks.com\/php\/php-google-geocode-example\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.webcodegeeks.com\/php\/php-google-geocode-example\/","url":"https:\/\/www.webcodegeeks.com\/php\/php-google-geocode-example\/","name":"PHP Google Geocode Example - Web Code Geeks - 2026","isPartOf":{"@id":"https:\/\/www.webcodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.webcodegeeks.com\/php\/php-google-geocode-example\/#primaryimage"},"image":{"@id":"https:\/\/www.webcodegeeks.com\/php\/php-google-geocode-example\/#primaryimage"},"thumbnailUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/php-logo.jpg","datePublished":"2016-11-14T14:15:46+00:00","dateModified":"2018-01-09T08:07:15+00:00","description":"In this example we will explain Google Map Geocoding, what it means and how we can manipulate the Google Map Geocoding API. For this example we will need:","breadcrumb":{"@id":"https:\/\/www.webcodegeeks.com\/php\/php-google-geocode-example\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.webcodegeeks.com\/php\/php-google-geocode-example\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/php\/php-google-geocode-example\/#primaryimage","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/php-logo.jpg","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2014\/10\/php-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.webcodegeeks.com\/php\/php-google-geocode-example\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.webcodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"PHP","item":"https:\/\/www.webcodegeeks.com\/category\/php\/"},{"@type":"ListItem","position":3,"name":"PHP Google Geocode Example"}]},{"@type":"WebSite","@id":"https:\/\/www.webcodegeeks.com\/#website","url":"https:\/\/www.webcodegeeks.com\/","name":"Web Code Geeks","description":"Web Developers Resource Center","publisher":{"@id":"https:\/\/www.webcodegeeks.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.webcodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.webcodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.webcodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.webcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webcodegeeks","https:\/\/x.com\/webcodegeeks"]},{"@type":"Person","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/417918d9b5811210265e8590509718b8","name":"Olayemi Odunayo","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.webcodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/016b2a353262962fceecf5c274161cd9ef60fdf1593ec95e71d37f5fd9b444f6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/016b2a353262962fceecf5c274161cd9ef60fdf1593ec95e71d37f5fd9b444f6?s=96&d=mm&r=g","caption":"Olayemi Odunayo"},"description":"I am a programmer and web developer, who has experience in developing websites and writing desktop and mobile applications. I have worked with both schematic and schemaless databases. I am also familiar with third party API and working with cloud servers. I do programming on the client side with Java, JavaScript, html, Ajax and CSS while I use PHP for server side programming.","sameAs":["https:\/\/www.webcodegeeks.com\/"],"url":"https:\/\/www.webcodegeeks.com\/author\/olayemi-odunayo\/"}]}},"_links":{"self":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/15224","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/users\/164"}],"replies":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/comments?post=15224"}],"version-history":[{"count":0,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/posts\/15224\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media\/930"}],"wp:attachment":[{"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/media?parent=15224"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/categories?post=15224"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.webcodegeeks.com\/wp-json\/wp\/v2\/tags?post=15224"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}