note 40738 added to ref.simplexml

From: Date: Fri, 12 Mar 2004 16:05:42 +0000
Subject: note 40738 added to ref.simplexml
Groups: php.notes 
Request: Send a blank email to php-notes+get-66741@lists.php.net to get a copy of this message
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: 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. ---- Manual Page -- http://www.php.net/manual/en/ref.simplexml.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+40738 Delete -- http://master.php.net/manage/user-notes.php?action=delete+40738&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+40738&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#66741) next »