note 91480 modified in function.simplexml-element-xpath by danbrown

From: Date: Thu, 11 Jun 2009 22:59:04 +0000
Subject: note 91480 modified in function.simplexml-element-xpath by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-156791@lists.php.net to get a copy of this message
The simplest way to count nodes in a XML doc: <?php $xml = new SimpleXMLElement($xmlstr); $xmlNode = $xml->xpath('root/yourNodeName'); $nodeCount = count($xmlNode); echo $nodeCount; ?> --was-- The simplest way to count nodes in a XML doc: $xml = new SimpleXMLElement($xmlstr); $xmlNode = $xml->xpath('root/yourNodeName'); $nodeCount = count($xmlNode); echo $nodeCount; http://php.net/manual/en/function.simplexml-element-xpath.php

« previous php.notes (#156791) next »