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 7445739
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T12:06:06+00:00 2026-05-29T12:06:06+00:00

I have an xml feed which I need to access an element from. However,

  • 0

I have an xml feed which I need to access an element from. However, none of the methods I have tried have worked.

Below is the xml feed in full:

<GeocodeResponse>
<status>OK</status>
<result>
    <type>locality</type>
    <type>political</type>
    <formatted_address>Liverpool, Merseyside, UK</formatted_address>
    <address_component>
        <long_name>Liverpool</long_name>
        <short_name>Liverpool</short_name>
        <type>locality</type>
        <type>political</type>
    </address_component>
    <address_component>
        <long_name>Merseyside</long_name>
        <short_name>Mersyd</short_name>
        <type>administrative_area_level_2</type>
        <type>political</type>
    </address_component>
    <address_component>
        <long_name>England</long_name>
        <short_name>England</short_name>
        <type>administrative_area_level_1</type>
        <type>political</type>
    </address_component>
    <address_component>
        <long_name>United Kingdom</long_name>
        <short_name>GB</short_name>
        <type>country</type>
        <type>political</type>
    </address_component>
    <geometry>
        <location>
            <lat>53.4115400</lat>
            <lng>-2.9901160</lng>
        </location>
        <location_type>APPROXIMATE</location_type>
        <viewport>
            <southwest>
                <lat>53.3049930</lat>
                <lng>-3.2462348</lng>
            </southwest>
            <northeast>
                <lat>53.5178208</lat>
                <lng>-2.7339972</lng>
            </northeast>
        </viewport>
        <bounds>
            <southwest>
                <lat>53.3115426</lat>
                <lng>-3.0191794</lng>
            </southwest>
            <northeast>
                <lat>53.5039071</lat>
                <lng>-2.8115043</lng>
            </northeast>
        </bounds>
    </geometry>
</result>
</GeocodeResponse>

I am trying to select geometry->location->lat->location and then within this lat and lng.

  • 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-05-29T12:06:08+00:00Added an answer on May 29, 2026 at 12:06 pm

    Have you tried simplexml_load_string or simplexml_load_file?
    Simply load your data with it and then access the node you want, like this:

    $xml = simplexml_load_file('your.xml');
    echo $xml->GeocodeResponse->result->geometry->location->lat;
    echo $xml->GeocodeResponse->result->geometry->location->lon;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a NSString which is passed from an xml feed........ NSString *strDate =@May
I have process which continuously downloads XML from the feed and saves it to
I have an XML feed (which I don't control) and I am trying to
I have a PHP-driven site that includes an XML stock feed, which is remotely
Basically I have an xml feed from an offsite server. The xml feed has
I have a xml feed which needs to be converted to HTML. How can
I have a client that sends an xml feed which I parse using the
I have an xml feed from Google Contacts API, but I have trouble reading
I'm developing a store which gets its product info from lots of xml feed,
I have a quite big XML output from an application. I need to process

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.