Jump to content

SimpleXML Reverse


Mute

Recommended Posts

Hi,

 

I'm parsing some XML and then spitting it out on the screen. What I'd like to be able to do is reverse the array that SimpleXML creates but for the life of me, I can't do it. Here's some sample XML.

 

<league>
<country>England</country>
<name>Premier League</name>
<all_matches>
<item>
  <round>1</round>
  <date>19 Aug 06</date>
  <result>1 - 1</result>
  <team1>Sheffield Utd.</team1>
  <team2>Liverpool</team2>
</item>
<item>
  <round>1</round>
  <date>19 Aug 06</date>
  <result>3 - 1</result>
  <team1>West Ham United</team1>
  <team2>Charlton</team2>
</item>
<item>
  <round>1</round>
  <date>19 Aug 06</date>
  <result>1 - 1</result>
  <team1>Arsenal</team1>
  <team2>Aston Villa</team2>
</item>
</allmatches>
</league>

 

I'd like to be able to show the <item> tags in reverse.

Link to comment
https://forums.phpfreaks.com/topic/40484-simplexml-reverse/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.