note 9901 added to count
| From: | martin at complinet dot com | Date: | Thu, 30 Nov 2000 09:31:48 +0000 |
| Subject: | note 9901 added to count | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-8292@lists.php.net to get a copy of this message | ||
The count function does not ignore null values in an array. To achieve this use this function.
function xcount($array) {
while (list($key, $value) = each($array)) {
if ($value) {
$count++;
}
}
return $count;
}
http://bugs.php.net/manual/function.count.php