Ignore comment node in SimpleXML [duplicate]
问题 This question already has an answer here : Closed 9 years ago . Possible Duplicate: find and edit comment element of html with php I have a comment in my XML file. If I load it with SimpleXML and then var_dump the node ( var_dump($xml->node->comment); ), it looks like this. ["comment"]=> object(SimpleXMLElement)#54 (0) { } The corresponding XML would look like this. <root> <node> <!-- some comment --> </node> </root> If I want to dynamically parse this, how can I detect if this