These forums have been archived and are now read-only.

The new forums are live and can be found at https://forums.eveonline.com/

EVE Technology Lab

 
  • Topic is locked indefinitely.
 

parse xml using php

Author
NGRU Prospector
Just In Time Science
#1 - 2013-08-28 05:30:23 UTC
given a call to the api https://wiki.eveonline.com/en/wiki/EVE_API_Account_APIKeyInfo


How would I extract a value from the row tag using php. I tried everything I know on simple xml and xml parse. I am just stuck on accessing data that is IN the tag as opposed to between them. Does anyone have a solution to the problem of how to pull a list of characters on an API key using php.
Louis Vitton
Viziam
Amarr Empire
#2 - 2013-08-28 10:14:59 UTC
phealING or Yapeal
NGRU Prospector
Just In Time Science
#3 - 2013-08-28 11:46:15 UTC
Im looking to not use a library.
Steve Ronuken
Fuzzwork Enterprises
Vote Steve Ronuken for CSM
#4 - 2013-08-28 12:11:00 UTC
http://pastebin.com/PitU8xUJ may be of interest

Woo! CSM XI!

Fuzzwork Enterprises

Twitter: @fuzzysteve on Twitter

Crasniya
Center for Advanced Studies
Gallente Federation
#5 - 2013-08-28 14:06:18 UTC  |  Edited by: Crasniya
This is what I used for AllianceList to pull data out of it. Might help you.

Quote:
$urlChar = "https://api.eveonline.com/eve/AllianceList.xml.aspx";
$data = file_get_contents($urlChar);
$list = new SimpleXMLElement($data);

foreach ($list->result->rowset->row as $row):
// Each alliance in the list
echo $row['name']; // will display the name of every alliance in the list

foreach ($row->rowset->row as $corp):
// Each corp in the list
endforeach;

endforeach;

Soraya Xel - Council of Planetary Management 1 - soraya@biomassed.net

NGRU Prospector
Just In Time Science
#6 - 2013-08-29 00:34:02 UTC
Thank you both!

Crasniya, you put me over the edge. I was missing the ' between the brackets on $row[]. Thanks again both of you for the help.
Crasniya
Center for Advanced Studies
Gallente Federation
#7 - 2013-08-29 00:45:58 UTC
Glad to be of service, I was just hacking this stuff together the other day. Glad to share what I learned.

Soraya Xel - Council of Planetary Management 1 - soraya@biomassed.net