Jump to content

Reading XML into PHP


n3mesis125

Recommended Posts

Hey Folks, I have something simliar to this in XML but i'm not sure how to access the attributes of each row. Is there an easy foreach() statement I can do to access the attributes? Basically I'm trying to loop through the below items and only spit out the solarSystemName data for each row set.

 

<?xml version='1.0' encoding='UTF-8'?>
<eveapi version="2">
  <currentTime>2007-12-14 20:19:41</currentTime>
  <result>
    <rowset name="solarSystems" key="solarSystemID" columns="solarSystemID,allianceID,constellationSovereignty,sovereigntyLevel,factionID,solarSystemName">
      <row solarSystemID="30023410" allianceID="0" constellationSovereignty="0" sovereigntyLevel="0" factionID="500002" solarSystemName="Embod" />
      <row solarSystemID="30001597" allianceID="1028876240" constellationSovereignty="0" sovereigntyLevel="3" factionID="0" solarSystemName="M-NP5O" />
      <row solarSystemID="30001815" allianceID="389924442" constellationSovereignty="0" sovereigntyLevel="3" factionID="0" solarSystemName="4AZV-W" />
      <row solarSystemID="30001816" allianceID="0" constellationSovereignty="0" sovereigntyLevel="0" factionID="0" solarSystemName="UNV-3J" />
      <row solarSystemID="30000479" allianceID="0" constellationSovereignty="824518128" sovereigntyLevel="0" factionID="0" solarSystemName="SLVP-D" />
      <row solarSystemID="30000480" allianceID="824518128" constellationSovereignty="824518128" sovereigntyLevel="3" factionID="0" solarSystemName="0-G8NO" />
    </rowset>
    <dataTime>2007-12-14 14:49:43</dataTime>
  </result>
  <cachedUntil>2007-12-15 02:19:41</cachedUntil>
</eveapi>

Link to comment
https://forums.phpfreaks.com/topic/169271-reading-xml-into-php/
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.