Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9012583
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:02:24+00:00 2026-06-16T03:02:24+00:00

My code is $result = file_get_contents(http://maps.googleapis.com/maps/api/geocode/json?address=.$stateName.,.$districtName.,.$cityName.&sensor=true); where $stateName , $districtName , $cityName are the

  • 0

My code is

$result = file_get_contents("http://maps.googleapis.com/maps/api/geocode/json?address=".$stateName.",".$districtName.",".$cityName."&sensor=true");

where $stateName, $districtName, $cityName are the values given by the user
After entering Kerala, Ernakulam, Angamaly as the stateName, districtName and cityName i got a result like this:

{
    "results": [
        {
            "address_components": [
                {
                    "long_name": "Angamaly",
                    "short_name": "Angamaly",
                    "types": [
                        "locality",
                        "political"
                    ]
                },
                {
                    "long_name": "Ernakulam",
                    "short_name": "Ernakulam",
                    "types": [
                        "administrative_area_level_2",
                        "political"
                    ]
                },
                {
                    "long_name": "Kerala State",
                    "short_name": "Kerala State",
                    "types": [
                        "administrative_area_level_1",
                        "political"
                    ]
                },
                {
                    "long_name": "India",
                    "short_name": "IN",
                    "types": [
                        "country",
                        "political"
                    ]
                }
            ],
            "formatted_address": "Angamaly, Kerala State, India",
            "geometry": {
                "bounds": {
                    "northeast": {
                        "lat": 10.2464704,
                        "lng": 76.39544959999999
                    },
                    "southwest": {
                        "lat": 10.1585335,
                        "lng": 76.3500451
                    }
                },
                "location": {
                    "lat": 10.212894,
                    "lng": 76.380601
                },
                "location_type": "APPROXIMATE",
                "viewport": {
                    "northeast": {
                        "lat": 10.2464704,
                        "lng": 76.39544959999999
                    },
                    "southwest": {
                        "lat": 10.1585335,
                        "lng": 76.3500451
                    }
                }
            },
            "types": [
                "locality",
                "political"
            ]
        }
    ],
    "status": "OK"
}

I need the latitude and longitude of the place. How can I retrieve the lat and lng from
geometry->bounds->northeast ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T03:02:26+00:00Added an answer on June 16, 2026 at 3:02 am
    $json = file_get_contents("http://maps.googleapis.com/maps/api/geocode/json?address=".$stateName.",".$districtName.",".$cityName."&sensor=true");
    
    $response = json_decode($json);
    echo $response->results[0]->geometry->bounds->northeast->lat;
    echo $response->results[0]->geometry->bounds->northeast->lng;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The Code: #!/usr/bin/php -q <?php while(true){ $rate_limit = json_decode(file_get_contents('http://api.twitter.com/1/account/rate_limit_status.json'),true); # Check how many API
I have the following code $List2 = json_decode(file_get_contents(https://___URL____&format=json),true); the following works perfectly echo '<pre>';print_r($List2);echo
I'm trying to parse the json response from the Google Geocode API but I'm
I'm trying to parse the following HTML from the following URL: http://md5.rednoize.com/?q=fbade9e36a3f36d3d676c1b808451dd7 The code:
Given the URL http://www.smartmoney.com/quote/FAST/?story=financials&timewindow=1&opt=YB&isFinprint=1&framework.view=smi_emptyView , how would you capture and print the contents of
I'm trying to get json response from stackoverflow api with file_get_contents(), but comes back
it seems that my code adds 6 bytes to the result file after encrypt
Code: var result = db.rows.Take(30).ToList().Select(a => AMethod(a)); db.rows.Take(30) is Linq-To-SQL I am using ToList()
Why does the code below result in org.datanucleus.exceptions.NucleusUserException: Object Manager has been closed? The
Hi I have the following code: boolean result = someexpression(); if(!result) { System.out.println(False...); }

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.