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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T13:37:03+00:00 2026-05-20T13:37:03+00:00

http://www.managerleague.com/export_data.pl?data=transfers&output=xml&hide_header=0 These are player sales from a browser game. I want to save some

  • 0

http://www.managerleague.com/export_data.pl?data=transfers&output=xml&hide_header=0

These are player sales from a browser game. I want to save some fields from these sales. I am fetching that xml with curl and storing on my server. Then do the following:

$xml_str = file_get_contents('salespage.xml');
$xml = new SimpleXMLElement($xml_str);
$items = $xml->xpath('*/transfer');

print_r($items);

foreach($items as $item) {
    echo $item['buyerTeamname'], ': ', $item['sellerTeamname'], "\n";
}

The array is empty and i cant seem to get anything from it. What am i doing wrong?

  • 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-20T13:37:04+00:00Added an answer on May 20, 2026 at 1:37 pm

    You forgot a slash in your xpath:

    $xml_str = file_get_contents('salespage.xml');
    $xml = new SimpleXMLElement($xml_str);
    $items = $xml->xpath('/*/transfer');
    
    print_r($items);
    
    foreach($items as $item) {
        echo $item->buyerTeamname, ': ', $item->sellerTeamname, "\n";
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

http://www.validome.org/xml/validate/?lang=en&viewSourceCode=1&url=http://45143.com/finance-feed/abc.xml&onlyWellFormed=1 check the url above for validator results. Line 171 in the XSD is
http://www.test.com/test.aspx?testinfo=&|& I am trying to replace & with values from a table. I got
http://www.example.com?a=1&a=2 has a valid form-urlencoded querystring and has two values ( 1 and 2
http://www.myserver.com/exile?Key1=Value1&Key2=Value2 When i get a request in this format to my server, how do
http://www.dennys.com I'm wondering how the top navigation was programmed, From the source code I
http://www.switchonthecode.com/tutorials/getting-started-with-opengl-es-for-the-iphone From the above link they created tutorial by No Nib File. But i
http://www.microsoft.com/downloads/details.aspx?familyid=ab99342f-5d1a-413d-8319-81da479ab0d7&displaylang=en there we can see: Full Package To download the full package, rather than
http://www.mathworks.com/matlabcentral/answers/1325-what-is-missing-from-matlab#answer_1931 The basic jist is you can't create a matrix and directly index it.
http://www.microsoft.com/downloads/details.aspx?FamilyId=21EABB90-958F-4B64-B5F1-73D0A413C8EF&displaylang=en The IE6/7/8 XP SP3 images made available for testing from Microsoft are set
http://www.leetcode.com/onlinejudge I am not able to see the difference between these two questions. To

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.