note 29721 added to function.array-count-values

From: Date: Sun, 23 Feb 2003 02:28:15 +0000
Subject: note 29721 added to function.array-count-values
Groups: php.notes 
Request: Send a blank email to php-notes+get-44364@lists.php.net to get a copy of this message
--This does not works with objects. If you have an array --filled with objects, you can not count them. I was recieveing the same error but i did not realize it until i turned on the "display_errors = " in the php.ini to "on". The funny thing is that the function was working as i expected it to and it was correctly counting my array values even after I turned on "display_errors = on". It was displaying that nasty "Warning: Can only count STRING and INTEGER values..." message but it was counting my array anyway. I experienced this behavior using PHP 4.2.1 and PHP 4.3.1 using Apache 2.0.4x and Windows XP. I am using the feature to count the comments i recieve on my personal blog at http://www.blodge.cjb.net and it has been working fine. I also did not have much luck with the suggestion to use "serialize()" but i am not familiar with that function. -- http://www.php.net/manual/en/function.array-count-values.php http://master.php.net/manage/user-notes.php?action=edit+29721 http://master.php.net/manage/user-notes.php?action=delete+29721 http://master.php.net/manage/user-notes.php?action=reject+29721

« previous php.notes (#44364) next »