note 22254 deleted from function.array-count-values by googleguy
| From: | googleguy@php.net | Date: | Tue, 22 Oct 2013 06:50:35 +0000 |
| Subject: | note 22254 deleted from function.array-count-values by googleguy | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-196671@lists.php.net to get a copy of this message | ||
Note Submitter: tschneider at formel4 dot de
----
This does not works with objects. If you have an array filled with objects, you can not count them.
Example:
<?php
$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...