dennismonsewicz Posted August 4, 2010 Share Posted August 4, 2010 I am trying to retrieve an attribute from a node and I keep getting the error: Warning: main() [function.main]: Node no longer exists in /Users/dmonsewicz/Projects/noosemonsewicz/api_stuff/index.php on line 70 PHP Code $xml = new SimpleXMLElement($result); $arr = $xml->tickets->attributes(); echo $arr['count']; XML <tickets count="0" type="array"></tickets> Any ideas on what I may be doing wrong? Link to comment https://forums.phpfreaks.com/topic/209810-simplexml-problems/ Share on other sites More sharing options...
dennismonsewicz Posted August 4, 2010 Author Share Posted August 4, 2010 I figured out what I was doing wrong. $xml = new SimpleXMLElement($result); $ticket_count = (string) $xml['count']; The first node in the XML was what I was trying to work with and I was going levels in. Link to comment https://forums.phpfreaks.com/topic/209810-simplexml-problems/#findComment-1095208 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.