{"id":1356,"date":"2016-03-27T16:04:44","date_gmt":"2016-03-27T16:04:44","guid":{"rendered":"https:\/\/www.codexworld.com\/?p=1356"},"modified":"2024-01-01T05:07:53","modified_gmt":"2024-01-01T05:07:53","slug":"get-address-from-latitude-longitude-using-google-maps-api-php","status":"publish","type":"post","link":"https:\/\/www.codexworld.com\/get-address-from-latitude-longitude-using-google-maps-api-php\/","title":{"rendered":"Get Address from Latitude and Longitude using Google Maps API and PHP"},"content":{"rendered":"<p>Latitude and longitude contain various information related to geo data. You can get geographic info including address from latitude &#038; longitude coordinates. Google Geocoding API provides an easy way to get address from latitude and longitude. If you have latitude &#038; longitude and want to find location or address, Google Maps API is very useful for converting latitude and longitude to address using PHP.<\/p>\n<p>The address can be retrieved from latitude and longitude coordinates with Geocoding API using PHP. In this tutorial, we will show you how to <b>get address from latitude and longitude in PHP<\/b> using Google Maps Geocoding API.<\/p>\n<h2>Google Maps API Key<\/h2>\n<p>The Google Maps API Key is required to post HTTP request to Geocoding API and get response. Before getting started create an API key on Google Cloud console.<\/p>\n<ul>\n<li>Go to the <a href=\"https:\/\/console.cloud.google.com\/\" target=\"_blank\" rel=\"noopener\">Google Cloud console<\/a>.<\/li>\n<li>Select the project from the Project drop-down menu at the top. If you don&#8217;t have an existing project, create a new one.<\/li>\n<li>In the left navigation pane, select the <b>APIs &#038; Services<\/b> &raquo; <b>Credentials<\/b>.<\/li>\n<li>In the Credentials page, select <b>CREATE CREDENTIALS<\/b> &raquo; <b>API key<\/b>.<\/li>\n<li>The API key will be created and a dialog will appear with the newly created API key.<\/li>\n<li>Navigate to the Library page from the left menu panel and make sure the <b>Geocoding API<\/b> is enabled.<\/li>\n<\/ul>\n<p>Copy this API key for later use in the script on the Google Maps Geocoding API request.<\/p>\n<h2>Get Address from Latitude and Longitude using PHP<\/h2>\n<p>The following example code shows steps to get address from given latitude and longitude using Google Geocoding API and PHP.<\/p>\n<ul>\n<li>Set the required values in the defined variable.\n<ul>\n<li><code>$GOOGLE_API_KEY<\/code> &#8211; Specify the Google API Key.<\/li>\n<li><code>$latitude<\/code> &#8211; Specify the latitude from which you want to retrieve the address.<\/li>\n<li><code>$longitude<\/code> &#8211; Specify the longitude from which you want to retrieve the address.<\/li>\n<\/ul>\n<\/li>\n<li>Format the latitude &#038; longitude by adding a comma (,) between them.<\/li>\n<li>Request Google Geocoding API (<code>https:\/\/maps.googleapis.com\/maps\/api\/geocode\/json<\/code>) using the file_get_contents() method in PHP.<\/li>\n<li>Pass latlng and key parameters in the Geocoding API URL.<\/li>\n<li>Decode JSON response returned by the Geocoding API using PHP json_decode() function.<\/li>\n<li>Get address info from the <code>formatted_address<\/code> object of API response.<\/li>\n<\/ul>\n<pre><span style=\"color: #0000BB\">&lt;?php <br \/> <br \/><\/span><span style=\"color: #FF8000\">\/\/&nbsp;Google&nbsp;Maps&nbsp;API&nbsp;Key <br \/><\/span><span style=\"color: #0000BB\">$GOOGLE_API_KEY&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #DD0000\">'YOUR_API_KEY_HERE'<\/span><span style=\"color: #007700\">; <br \/> <br \/><\/span><span style=\"color: #FF8000\">\/\/&nbsp;Latitude&nbsp;&amp;&nbsp;Longitude&nbsp;from&nbsp;which&nbsp;the&nbsp;address&nbsp;will&nbsp;be&nbsp;retrieved <br \/><\/span><span style=\"color: #0000BB\">$latitude&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #DD0000\">'38.897952'<\/span><span style=\"color: #007700\">; <br \/><\/span><span style=\"color: #0000BB\">$longitude&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #DD0000\">'-77.036562'<\/span><span style=\"color: #007700\">; <br \/> <br \/><\/span><span style=\"color: #FF8000\">\/\/&nbsp;Formatted&nbsp;latitude&nbsp;&amp;&nbsp;longitude&nbsp;string <br \/><\/span><span style=\"color: #0000BB\">$formatted_latlng&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">trim<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$latitude<\/span><span style=\"color: #007700\">).<\/span><span style=\"color: #DD0000\">','<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">trim<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$longitude<\/span><span style=\"color: #007700\">); <br \/> <br \/><\/span><span style=\"color: #FF8000\">\/\/&nbsp;Get&nbsp;geo&nbsp;data&nbsp;from&nbsp;Google&nbsp;Maps&nbsp;API&nbsp;by&nbsp;lat&nbsp;lng <br \/><\/span><span style=\"color: #0000BB\">$geocodeFromLatLng&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">file_get_contents<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #DD0000\">\"https:\/\/maps.googleapis.com\/maps\/api\/geocode\/json?latlng=<\/span><span style=\"color: #007700\">{<\/span><span style=\"color: #0000BB\">$formatted_latlng<\/span><span style=\"color: #007700\">}<\/span><span style=\"color: #DD0000\">&amp;key=<\/span><span style=\"color: #007700\">{<\/span><span style=\"color: #0000BB\">$GOOGLE_API_KEY<\/span><span style=\"color: #007700\">}<\/span><span style=\"color: #DD0000\">\"<\/span><span style=\"color: #007700\">); <br \/> <br \/><\/span><span style=\"color: #FF8000\">\/\/&nbsp;Decode&nbsp;JSON&nbsp;data&nbsp;returned&nbsp;by&nbsp;API <br \/><\/span><span style=\"color: #0000BB\">$apiResponse&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">json_decode<\/span><span style=\"color: #007700\">(<\/span><span style=\"color: #0000BB\">$geocodeFromLatLng<\/span><span style=\"color: #007700\">); <br \/> <br \/><\/span><span style=\"color: #FF8000\">\/\/&nbsp;Retrieve&nbsp;address&nbsp;from&nbsp;API&nbsp;data <br \/><\/span><span style=\"color: #0000BB\">$formatted_address&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$apiResponse<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">results<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #0000BB\">0<\/span><span style=\"color: #007700\">]-&gt;<\/span><span style=\"color: #0000BB\">formatted_address<\/span><span style=\"color: #007700\">; <br \/> <br \/><\/span><span style=\"color: #0000BB\">?&gt;<\/span><\/pre>\n<p>Additionally, you can get the latitude, longitude, and place ID using the following code.<\/p>\n<pre><span style=\"color: #0000BB\">$latitude&nbsp;&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$apiResponse<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">results<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #0000BB\">0<\/span><span style=\"color: #007700\">]-&gt;<\/span><span style=\"color: #0000BB\">geometry<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">location<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">lat<\/span><span style=\"color: #007700\">;&nbsp; <br \/><\/span><span style=\"color: #0000BB\">$longitude&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$apiResponse<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">results<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #0000BB\">0<\/span><span style=\"color: #007700\">]-&gt;<\/span><span style=\"color: #0000BB\">geometry<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">location<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">lng<\/span><span style=\"color: #007700\">; <br \/><\/span><span style=\"color: #0000BB\">$place_id&nbsp;<\/span><span style=\"color: #007700\">=&nbsp;<\/span><span style=\"color: #0000BB\">$apiResponse<\/span><span style=\"color: #007700\">-&gt;<\/span><span style=\"color: #0000BB\">results<\/span><span style=\"color: #007700\">[<\/span><span style=\"color: #0000BB\">0<\/span><span style=\"color: #007700\">]-&gt;<\/span><span style=\"color: #0000BB\">place_id<\/span><span style=\"color: #007700\">;<\/span><\/pre>\n<p>Display the address, latitude, longitude, and place ID on the web page.<\/p>\n<pre><span style=\"color: #FF8000\">\/\/&nbsp;Render&nbsp;the&nbsp;address&nbsp;of&nbsp;the&nbsp;given&nbsp;latitude&nbsp;&amp;&nbsp;longitude <br \/><\/span><span style=\"color: #007700\">echo&nbsp;<\/span><span style=\"color: #DD0000\">'Address:&nbsp;'<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$formatted_address<\/span><span style=\"color: #007700\">; <br \/> <br \/>echo&nbsp;<\/span><span style=\"color: #DD0000\">'&lt;br\/&gt;Place&nbsp;ID:&nbsp;'<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$place_id<\/span><span style=\"color: #007700\">; <br \/>echo&nbsp;<\/span><span style=\"color: #DD0000\">'&lt;br\/&gt;Latitude:&nbsp;'<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$latitude<\/span><span style=\"color: #007700\">; <br \/>echo&nbsp;<\/span><span style=\"color: #DD0000\">'&lt;br\/&gt;Longitude:&nbsp;'<\/span><span style=\"color: #007700\">.<\/span><span style=\"color: #0000BB\">$longitude<\/span><span style=\"color: #007700\">;<\/span><\/pre>\n<h2>Conclusion<\/h2>\n<p>Hope this simple script will be very useful for getting the address from latitude and longitude. If you want to use the Google Maps Geocode API to get the other information, see some other useful scripts from the below tutorial links.<\/p>\n<ul>\n<li><a href=\"https:\/\/www.codexworld.com\/get-latitude-longitude-from-address-using-google-maps-api-php\/\">Get Latitude and Longitude from Address using Google Maps API and PHP<\/a><\/li>\n<li><a href=\"https:\/\/www.codexworld.com\/get-zipcode-from-address-using-google-maps-api-php\/\">Get zipcode from address using Google Maps API and PHP<\/a><\/li>\n<li><a href=\"https:\/\/www.codexworld.com\/distance-between-two-addresses-google-maps-api-php\/\">Distance between two addresses using Google Maps API and PHP<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Latitude and longitude contain various information related to geo data. You can get geographic info including address from latitude &#038; longitude coordinates. Google Geocoding API provides an easy way to get address from latitude and <\/p>\n","protected":false},"author":1,"featured_media":5548,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[4],"tags":[250,380,13,35,14],"class_list":["post-1356","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-php","tag-api","tag-geocoding","tag-google-api","tag-google-maps-api","tag-php","cat-4-id","has_thumb"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Get Address from Latitude and Longitude using Google Maps API and PHP - CodexWorld<\/title>\n<meta name=\"description\" content=\"Find Location from Latitude and Longitude using PHP - PHP function to get address from latitude and longitude using Google Maps API and PHP.\" \/>\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.codexworld.com\/get-address-from-latitude-longitude-using-google-maps-api-php\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Get Address from Latitude and Longitude using Google Maps API and PHP - CodexWorld\" \/>\n<meta property=\"og:description\" content=\"Find Location from Latitude and Longitude using PHP - PHP function to get address from latitude and longitude using Google Maps API and PHP.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.codexworld.com\/get-address-from-latitude-longitude-using-google-maps-api-php\/\" \/>\n<meta property=\"og:site_name\" content=\"CodexWorld\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/codexworld\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/codexworld\" \/>\n<meta property=\"article:published_time\" content=\"2016-03-27T16:04:44+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-01-01T05:07:53+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.codexworld.com\/wp-content\/uploads\/2016\/03\/get-address-from-latitude-longitude-using-google-maps-geocoding-api-php-codexworld.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"1080\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"CodexWorld\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@codexworldblog\" \/>\n<meta name=\"twitter:site\" content=\"@codexworldweb\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"CodexWorld\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/get-address-from-latitude-longitude-using-google-maps-api-php\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/get-address-from-latitude-longitude-using-google-maps-api-php\\\/\"},\"author\":{\"name\":\"CodexWorld\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#\\\/schema\\\/person\\\/9da51d8fa3cdefeb5ec9c69136d4baf0\"},\"headline\":\"Get Address from Latitude and Longitude using Google Maps API and PHP\",\"datePublished\":\"2016-03-27T16:04:44+00:00\",\"dateModified\":\"2024-01-01T05:07:53+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/get-address-from-latitude-longitude-using-google-maps-api-php\\\/\"},\"wordCount\":465,\"commentCount\":3,\"publisher\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/get-address-from-latitude-longitude-using-google-maps-api-php\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2016\\\/03\\\/get-address-from-latitude-longitude-using-google-maps-geocoding-api-php-codexworld.png\",\"keywords\":[\"API\",\"Geocoding\",\"Google API\",\"Google Maps API\",\"PHP\"],\"articleSection\":[\"PHP\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.codexworld.com\\\/get-address-from-latitude-longitude-using-google-maps-api-php\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/get-address-from-latitude-longitude-using-google-maps-api-php\\\/\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/get-address-from-latitude-longitude-using-google-maps-api-php\\\/\",\"name\":\"Get Address from Latitude and Longitude using Google Maps API and PHP - CodexWorld\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/get-address-from-latitude-longitude-using-google-maps-api-php\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/get-address-from-latitude-longitude-using-google-maps-api-php\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2016\\\/03\\\/get-address-from-latitude-longitude-using-google-maps-geocoding-api-php-codexworld.png\",\"datePublished\":\"2016-03-27T16:04:44+00:00\",\"dateModified\":\"2024-01-01T05:07:53+00:00\",\"description\":\"Find Location from Latitude and Longitude using PHP - PHP function to get address from latitude and longitude using Google Maps API and PHP.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/get-address-from-latitude-longitude-using-google-maps-api-php\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.codexworld.com\\\/get-address-from-latitude-longitude-using-google-maps-api-php\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/get-address-from-latitude-longitude-using-google-maps-api-php\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2016\\\/03\\\/get-address-from-latitude-longitude-using-google-maps-geocoding-api-php-codexworld.png\",\"contentUrl\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2016\\\/03\\\/get-address-from-latitude-longitude-using-google-maps-geocoding-api-php-codexworld.png\",\"width\":1920,\"height\":1080,\"caption\":\"get-address-from-latitude-longitude-using-google-maps-geocoding-api-php-codexworld\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/get-address-from-latitude-longitude-using-google-maps-api-php\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.codexworld.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Get Address from Latitude and Longitude using Google Maps API and PHP\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#website\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/\",\"name\":\"CodexWorld\",\"description\":\"Web &amp; Mobile App Development Company\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.codexworld.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#organization\",\"name\":\"CodexWorld\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2014\\\/09\\\/codexworld-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.codexworld.com\\\/wp-content\\\/uploads\\\/2014\\\/09\\\/codexworld-logo.png\",\"width\":200,\"height\":19,\"caption\":\"CodexWorld\"},\"image\":{\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/codexworld\",\"https:\\\/\\\/x.com\\\/codexworldweb\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/codexworld\",\"https:\\\/\\\/www.youtube.com\\\/codexworld\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.codexworld.com\\\/#\\\/schema\\\/person\\\/9da51d8fa3cdefeb5ec9c69136d4baf0\",\"name\":\"CodexWorld\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g\",\"caption\":\"CodexWorld\"},\"description\":\"CodexWorld is a programming blog, one-stop destination for web professionals \u2014 developers, programmers, freelancers, and site owners.\",\"sameAs\":[\"http:\\\/\\\/www.codexworld.com\",\"https:\\\/\\\/www.facebook.com\\\/codexworld\",\"https:\\\/\\\/x.com\\\/codexworldblog\"],\"url\":\"https:\\\/\\\/www.codexworld.com\\\/author\\\/nitya192265\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Get Address from Latitude and Longitude using Google Maps API and PHP - CodexWorld","description":"Find Location from Latitude and Longitude using PHP - PHP function to get address from latitude and longitude using Google Maps API and PHP.","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.codexworld.com\/get-address-from-latitude-longitude-using-google-maps-api-php\/","og_locale":"en_US","og_type":"article","og_title":"Get Address from Latitude and Longitude using Google Maps API and PHP - CodexWorld","og_description":"Find Location from Latitude and Longitude using PHP - PHP function to get address from latitude and longitude using Google Maps API and PHP.","og_url":"https:\/\/www.codexworld.com\/get-address-from-latitude-longitude-using-google-maps-api-php\/","og_site_name":"CodexWorld","article_publisher":"https:\/\/www.facebook.com\/codexworld","article_author":"https:\/\/www.facebook.com\/codexworld","article_published_time":"2016-03-27T16:04:44+00:00","article_modified_time":"2024-01-01T05:07:53+00:00","og_image":[{"width":1920,"height":1080,"url":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2016\/03\/get-address-from-latitude-longitude-using-google-maps-geocoding-api-php-codexworld.png","type":"image\/png"}],"author":"CodexWorld","twitter_card":"summary_large_image","twitter_creator":"@codexworldblog","twitter_site":"@codexworldweb","twitter_misc":{"Written by":"CodexWorld","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.codexworld.com\/get-address-from-latitude-longitude-using-google-maps-api-php\/#article","isPartOf":{"@id":"https:\/\/www.codexworld.com\/get-address-from-latitude-longitude-using-google-maps-api-php\/"},"author":{"name":"CodexWorld","@id":"https:\/\/www.codexworld.com\/#\/schema\/person\/9da51d8fa3cdefeb5ec9c69136d4baf0"},"headline":"Get Address from Latitude and Longitude using Google Maps API and PHP","datePublished":"2016-03-27T16:04:44+00:00","dateModified":"2024-01-01T05:07:53+00:00","mainEntityOfPage":{"@id":"https:\/\/www.codexworld.com\/get-address-from-latitude-longitude-using-google-maps-api-php\/"},"wordCount":465,"commentCount":3,"publisher":{"@id":"https:\/\/www.codexworld.com\/#organization"},"image":{"@id":"https:\/\/www.codexworld.com\/get-address-from-latitude-longitude-using-google-maps-api-php\/#primaryimage"},"thumbnailUrl":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2016\/03\/get-address-from-latitude-longitude-using-google-maps-geocoding-api-php-codexworld.png","keywords":["API","Geocoding","Google API","Google Maps API","PHP"],"articleSection":["PHP"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.codexworld.com\/get-address-from-latitude-longitude-using-google-maps-api-php\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.codexworld.com\/get-address-from-latitude-longitude-using-google-maps-api-php\/","url":"https:\/\/www.codexworld.com\/get-address-from-latitude-longitude-using-google-maps-api-php\/","name":"Get Address from Latitude and Longitude using Google Maps API and PHP - CodexWorld","isPartOf":{"@id":"https:\/\/www.codexworld.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.codexworld.com\/get-address-from-latitude-longitude-using-google-maps-api-php\/#primaryimage"},"image":{"@id":"https:\/\/www.codexworld.com\/get-address-from-latitude-longitude-using-google-maps-api-php\/#primaryimage"},"thumbnailUrl":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2016\/03\/get-address-from-latitude-longitude-using-google-maps-geocoding-api-php-codexworld.png","datePublished":"2016-03-27T16:04:44+00:00","dateModified":"2024-01-01T05:07:53+00:00","description":"Find Location from Latitude and Longitude using PHP - PHP function to get address from latitude and longitude using Google Maps API and PHP.","breadcrumb":{"@id":"https:\/\/www.codexworld.com\/get-address-from-latitude-longitude-using-google-maps-api-php\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.codexworld.com\/get-address-from-latitude-longitude-using-google-maps-api-php\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codexworld.com\/get-address-from-latitude-longitude-using-google-maps-api-php\/#primaryimage","url":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2016\/03\/get-address-from-latitude-longitude-using-google-maps-geocoding-api-php-codexworld.png","contentUrl":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2016\/03\/get-address-from-latitude-longitude-using-google-maps-geocoding-api-php-codexworld.png","width":1920,"height":1080,"caption":"get-address-from-latitude-longitude-using-google-maps-geocoding-api-php-codexworld"},{"@type":"BreadcrumbList","@id":"https:\/\/www.codexworld.com\/get-address-from-latitude-longitude-using-google-maps-api-php\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.codexworld.com\/"},{"@type":"ListItem","position":2,"name":"Get Address from Latitude and Longitude using Google Maps API and PHP"}]},{"@type":"WebSite","@id":"https:\/\/www.codexworld.com\/#website","url":"https:\/\/www.codexworld.com\/","name":"CodexWorld","description":"Web &amp; Mobile App Development Company","publisher":{"@id":"https:\/\/www.codexworld.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.codexworld.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.codexworld.com\/#organization","name":"CodexWorld","url":"https:\/\/www.codexworld.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.codexworld.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2014\/09\/codexworld-logo.png","contentUrl":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2014\/09\/codexworld-logo.png","width":200,"height":19,"caption":"CodexWorld"},"image":{"@id":"https:\/\/www.codexworld.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/codexworld","https:\/\/x.com\/codexworldweb","https:\/\/www.linkedin.com\/company\/codexworld","https:\/\/www.youtube.com\/codexworld"]},{"@type":"Person","@id":"https:\/\/www.codexworld.com\/#\/schema\/person\/9da51d8fa3cdefeb5ec9c69136d4baf0","name":"CodexWorld","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/cf4999db3b409de559f80677afa01729bb2eeda19be273c254e8b2c22729e386?s=96&r=g","caption":"CodexWorld"},"description":"CodexWorld is a programming blog, one-stop destination for web professionals \u2014 developers, programmers, freelancers, and site owners.","sameAs":["http:\/\/www.codexworld.com","https:\/\/www.facebook.com\/codexworld","https:\/\/x.com\/codexworldblog"],"url":"https:\/\/www.codexworld.com\/author\/nitya192265\/"}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/www.codexworld.com\/wp-content\/uploads\/2016\/03\/get-address-from-latitude-longitude-using-google-maps-geocoding-api-php-codexworld.png","jetpack_shortlink":"https:\/\/wp.me\/p6bxIh-lS","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/posts\/1356","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/comments?post=1356"}],"version-history":[{"count":6,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/posts\/1356\/revisions"}],"predecessor-version":[{"id":5547,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/posts\/1356\/revisions\/5547"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/media\/5548"}],"wp:attachment":[{"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/media?parent=1356"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/categories?post=1356"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.codexworld.com\/wp-json\/wp\/v2\/tags?post=1356"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}