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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T20:47:19+00:00 2026-05-24T20:47:19+00:00

I am retrieving some similar XML from the Yahoo API – <ResultSet version=1.0> <Error>0</Error>

  • 0

I am retrieving some similar XML from the Yahoo API –

<ResultSet version="1.0">
  <Error>0</Error>
  <ErrorMessage>No error</ErrorMessage>
  <Locale>us_US</Locale>
  <Quality>99</Quality>
  <Found>1</Found>
  <Result> 
     <quality>99</quality>
     <latitude>51.501690</latitude>
     <longitude>-0.125442</longitude>
     <offsetlat>51.501690</offsetlat>
     <offsetlon>-0.125442</offsetlon>
     <radius>500</radius>
     <name>51.501690392606974, -0.1254415512084961</name>
     <woeid>26352062</woeid>
  </Result>
</ResultSet>

How would I go about accessing the child woeid for example?

I can access quality, longitude etc but I am a little unsure as to how to access a child of a child – is this even the correct terminology?

Any help appreciated.

Thanks

  • 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-24T20:47:20+00:00Added an answer on May 24, 2026 at 8:47 pm
    <?php
    $xml = simplexml_load_file("XML.xml");
    //echo woeid
    echo $xml->Result->woeid;
    ?>
    

    That’s just an easy example of how to do it with the xml-file you provided.

    You might also run into files where there’s more than one <Result> child, in which case you can access them all like this:

    <?php
    $xml = simplexml_load_file("XML.xml");
    //echo all woeid's
    foreach($xml->Result as $result) {
        echo $result->woeid;
    }
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can anybody help me with retrieving some elements from the following example text: sdfaasdflj
For some reason I'm having a problem retrieving data from my database. It leaves
When retrieving a lookup code value from a table, some folks do this... Dim
I am building an application using Action script 3 I am retrieving some XML
I am using Django for development, retrieving some text containing a newline character from
In my java code,I am retrieving some multibyte data from database and making some
I am retrieving some data from the server which looks something like this: 1:some
I am retrieving some records from mongo using scala. These are plain json records.
how to cache data source contents? suppose I'm retrieving some records from my sql
So I'm retrieving some JSON data from a website and using the standard urlopen()

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.