note 40738 deleted from ref.simplexml by kennyt
| From: | kennyt@php.net | Date: | Sun, 18 Jul 2004 16:57:33 +0000 |
| Subject: | note 40738 deleted from ref.simplexml by kennyt | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-73492@lists.php.net to get a copy of this message | ||
Note Submitter: cvladan@list.co.yu
----
I had a problem detecting the existance of a node, in SimpleXML. Meaning, if exists, even if empty.
I solved this stupid problem by using this function:
<?php
function node_exist($objSXml)
{
$objTemp = (object) $objSXml;
return ($objTemp->scalar != null);
}
?>
It would be nice to have something more logical, as SimpleXML function. Or, when you cast to (bool),
to evaluate to node existance.