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? Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.