note 96848 added to simplexmlelement.count
| From: | ghoffman at salientdigital dot com | Date: | Thu, 18 Mar 2010 22:53:05 +0000 |
| Subject: | note 96848 added to simplexmlelement.count | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-167183@lists.php.net to get a copy of this message | ||
I found this to be counter-intuitive:
$rows = $xml->{'nodename'};
$total = $rows->count( );
// Fatal error:
// Call to undefined method SimpleXMLElement::count()
$total = $xml->{'nodename'}->count;
// object(SimpleXMLElement)[5]
$total = (int) $xml->{'nodename'}->count;
// 5
----
Server IP: 192.41.40.227
Probable Submitter: 70.166.218.198
----
Manual Page -- http://www.php.net/manual/en/simplexmlelement.count.php
Edit -- https://master.php.net/note/edit/96848
Del: integrated -- https://master.php.net/note/delete/96848/integrated
Del: useless -- https://master.php.net/note/delete/96848/useless
Del: bad code -- https://master.php.net/note/delete/96848/bad+code
Del: spam -- https://master.php.net/note/delete/96848/spam
Del: non-english -- https://master.php.net/note/delete/96848/non-english
Del: in docs -- https://master.php.net/note/delete/96848/in+docs
Del: other reasons-- https://master.php.net/note/delete/96848
Reject -- https://master.php.net/note/reject/96848
Search -- https://master.php.net/manage/user-notes.php