I am pulling values from an API using simple XML. Earlier calls worked fine but for the life of me I cannot get this last piece to pull data. I am making the call with:
$postq='https://api.eveonline.com/char/SkillQueue.xml.aspx?keyid='.$key.'&vCode='.$code;
$qpull = simplexml_load_file($postq);
An example of the expected output is:
<?xml version='1.0' encoding='UTF-8'?>
<eveapi version="2">
<currentTime>2009-03-18 13:19:43</currentTime>
<result>
<rowset name="skillqueue" key="queuePosition" columns="queuePosition,typeID,level,startSP,endSP,startTime,endTime">
<row queuePosition="1" typeID="11441" level="3" startSP="7072" endSP="40000" startTime="2009-03-18 02:01:06" endTime="2009-03-18 15:19:21" />
<row queuePosition="2" typeID="20533" level="4" startSP="112000" endSP="633542" startTime="2009-03-18 15:19:21" endTime="2009-03-30 03:16:14" />
</rowset>
</result>
<cachedUntil>2009-03-18 13:34:43</cachedUntil>
</eveapi>
The call works and I am currently at the following:
foreach( $qpull -> result as $c1)
{
foreach( $c1 -> rowset as $c2)
{
foreach( $c2 -> row as $c3)
{
var_dump($c3);
}
}
}
This may be over complicating how it needs to be done but this is after hours of trying different ways to do it.
This is an example of the output:
object(SimpleXMLElement)[20]
public '@attributes' =>
array (size=7)
'queuePosition' => string '0' (length=1)
'typeID' => string '3425' (length=4)
'level' => string '1' (length=1)
'startSP' => string '0' (length=1)
'endSP' => string '500' (length=3)
'startTime' => string '2014-08-04 16:16:11' (length=19)
'endTime' => string '2014-08-04 16:30:16' (length=19)
object(SimpleXMLElement)[21]
public '@attributes' =>
array (size=7)
'queuePosition' => string '1' (length=1)
'typeID' => string '11566' (length=5)
'level' => string '1' (length=1)
'startSP' => string '0' (length=1)
'endSP' => string '500' (length=3)
'startTime' => string '2014-08-04 16:30:16' (length=19)
'endTime' => string '2014-08-04 16:44:21' (length=19)
However if I try to select a value using:
var_dump($c3->level);
I am just getting blanks and cannot work out what I am doing wrong.
Thanks.