General Question
How would I check if an XML element exists in PHP?
Asked by lefteh (9434)
January 28th, 2009
Sorry guys. Same script, different problem. Google is no help.
Here is the script.
The script pulls out the “when” element and its attributes. The problem is that not every entry has a when element. How can I skip these records? I am aware of a hasAttribute function, but I can’t seem to find any equivalent for elements. I’ve played around with several techniques, and nothing has worked.
If these entries are not skipped, the following error occurs:
Fatal error: Call to a member function getAttributeNode() on a non-object
Thanks again..
Observing members:
0
Composing members:
0
2 Answers
Answer this question
This question is in the General Section. Responses must be helpful and on-topic.
Have a question?
Ask Fluther!