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

  • Home
  • SEARCH
  • 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 599699
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T16:31:34+00:00 2026-05-13T16:31:34+00:00

Hi guys first post on this site so excuse the formatting. I’m new to

  • 0

Hi guys first post on this site so excuse the formatting.

I’m new to xml parsing with php and well this xml feed has me stumped. I get using purely element based formats, but attributes this complex not so much. I tried to get the site to change to easier element based format but they’re sticking with this format using attributes and I’m having a hard time pulling all the data in a listing/ranking style format particularly for each members’ rankings and points.

example of xml file with only 2 members, but in reality there could 100s and 1000s depending on team id.

<sitemembers>
  <members>
    <member>
      <name>username</name>
      <team id="1200">team1 name</team>
      <rank>
        <today rank="34" points="613.30" results="70"/>
        <yesterday rank="33" points="614.20" results="70"/>
        <lastweek rank="60" points="541.70" results="68"/>
        <lastmonth rank="163" points="415.60" results="63"/>
      </rank>
      <awards>
        <global gold="0" silver="0" bronze="0" medal="1"/>
        <local gold="5" silver="2" bronze="0" medal="3"/>
      </awards>
    </member>
    <member>
      <name>username2</name>
      <team id="1200">team1 name</team>
      <rank>
        <today rank="46" points="577.80" results="178"/>
        <yesterday rank="45" points="580.00" results="178"/>
        <lastweek rank="40" points="586.60" results="178"/>
        <lastmonth rank="75" points="503.60" results="169"/>
      </rank>
      <awards>
        <global gold="0" silver="0" bronze="0" medal="0"/>
        <local gold="0" silver="2" bronze="2" medal="6"/>
      </awards>
    </member>
  </members>
</sitemembers>

and the output wanted in format

    Members ranking for team1 name (teamid: 1200)

    1. username
    Current rank: 34 : 613.30 pts (submissions: 70)
    Yesterday rank: 33 : 614.20 ps (submissions: 70)
    Last week rank: 60 : 541.70 pts (submissions: 68)
    Last month rank: 163 : 415.60 (submissions: 63)
    Global awards: 1 medals - [Gold: 0 Silver: 0 Bronze: 0]
    Local awards: 3 medals - [Gold: 5 Silver: 2 Bronze: 0]

    2. username2
    Current rank: 46 : 577.80 pts (submissions: 178)
    Yesterday rank: 45 : 580.00 ps (submissions: 178)
    Last week rank: 40 : 588.60 pts (submissions: 178)
    Last month rank: 75 : 503.60 (submissions: 169)
    Global awards: 0 medals - [Gold: 0 Silver: 0 Bronze: 0]
    Local awards: 6 medals - [Gold: 0 Silver: 2 Bronze: 2]

Any help is appreciated in steering me in the right direction. 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-13T16:31:35+00:00Added an answer on May 13, 2026 at 4:31 pm

    Use SimpleXML

    $sitemembers = simplexml_load_string($xml);
    
    echo '<ol>';
    foreach ($sitemembers->members->member as $member)
    {
        $today = $member->rank->today;
        echo '<li>', $member->name, '<br />',
             'Current rank: ', $today['rank'], ' : ', $today['points'];
        // etc...
        echo '</li>';
    }
    echo '</ol>';
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi guys this will be my first post and am pretty new to Objective-C
Well, this is my first post here and really enjoying the site. I have
This is my first post on the forum, hope all of you guys are
My very first post here! I have been using this site for many years
Hi guys this is just my first post, is it possible to access an
Hi this is my first post here hope you all are well. So Im
First post, but I've been lurking around this site for a long while now,
this is my first post to stackoverflow, but I use you guys knowledge constantly,
This is my first step to programming.guys your help hands required.I watched youtube video
Frequent visitor but first post here on StackOverflow, I'm hoping that you guys might

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.