note 22254 added to function.array-count-values

From: Date: Wed, 12 Jun 2002 11:09:37 +0000
Subject: note 22254 added to function.array-count-values
Groups: php.notes 
Request: Send a blank email to php-notes+get-31731@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. Example: $myArray = array(); for ($i = 0 ; $i < 10 ; $i++) { $myObject = new MyObject(); $myArray[$i] = $myObject; } echo (array_count_values($myArray)); This gives you: Warning: Can only count STRING and INTEGER values... Found no solution for this yet... -- http://www.php.net/manual/en/function.array-count-values.php http://master.php.net/manage/user-notes.php?action=edit+22254 http://master.php.net/manage/user-notes.php?action=delete+22254 http://master.php.net/manage/user-notes.php?action=reject+22254

« previous php.notes (#31731) next »