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 SimpleXMLElement is in fact a comment? Preferably without checking if the key is comment
.
Thanks.
Update: I don't want to read the comment, I want to ignore it. Realized this was unclear.