pernest Posted May 23, 2010 Share Posted May 23, 2010 Hi, I've been trying to use simple XML and everything is going well, until I tried to use count. I've even copied and pasted the example from the php manual (added nothing to it) http://www.php.net/manual/en/simplexmlelement.count.php but I just get Call to undefined method SimpleXMLElement::count(). The weird thing is that all the other simpleXML member functions word exactly as documents. I can't be certain, but I have a gut feeling that whilst getting to grips with simpleXML I used the count() function successfully a few days ago. running phpinfo() on my server tells me that I'm using PHP Version 5.2.11 and simpleXML is revision Revision: 272374 Could someone else please try this and let me know if its a problem unique to me and my stupid host, or is it a php problem. Thanks in advance Quote Link to comment https://forums.phpfreaks.com/topic/202678-simplexml-count-call-to-undefined-method/ Share on other sites More sharing options...
Alex Posted May 23, 2010 Share Posted May 23, 2010 Right from the page with the example you linked to: SimpleXMLElement::count (PHP 5 >= 5.3.0) Quote Link to comment https://forums.phpfreaks.com/topic/202678-simplexml-count-call-to-undefined-method/#findComment-1062343 Share on other sites More sharing options...
Daniel0 Posted May 23, 2010 Share Posted May 23, 2010 The regular count function should work equally well for versions prior to 5.3.0. Quote Link to comment https://forums.phpfreaks.com/topic/202678-simplexml-count-call-to-undefined-method/#findComment-1062352 Share on other sites More sharing options...
pernest Posted May 23, 2010 Author Share Posted May 23, 2010 Right from the page with the example you linked to: SimpleXMLElement::count (PHP 5 >= 5.3.0) Thanks! I'm feeling pretty dumb now! Quote Link to comment https://forums.phpfreaks.com/topic/202678-simplexml-count-call-to-undefined-method/#findComment-1062355 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.