note 35961 added to function.array-count-values
| From: | sarok at phreaker dot net | Date: | Sat, 20 Sep 2003 20:10:29 +0000 |
| Subject: | note 35961 added to function.array-count-values | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-56821@lists.php.net to get a copy of this message | ||
As programmer at bardware dot de is saying, the function will also count empty keys. But its a much
easier way to tell if the keys are empty or not. Example:
$i = '0';
foreach ($array as $value) {
if ($value != FALSE) {
$i++;
}
}
echo $i;
----
Manual Page -- http://www.php.net/manual/en/function.array-count-values.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+35961
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+35961&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+35961&report=yes