note 56488 added to function.count
| From: | support at akwad dot net | Date: | Mon, 05 Sep 2005 00:28:32 +0000 |
| Subject: | note 56488 added to function.count | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-94730@lists.php.net to get a copy of this message | ||
NOTE: count will return (1) for any data type except null
so i found it usefull for using this very simple function to count only arrays otherwise it return
false
function count_arr($data){
if(is_array($data)) return count($data);
return false;
}
----
Manual Page -- http://www.php.net/manual/en/function.count.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+56488
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+56488&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+56488&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+56488&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+56488&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+56488&report=yes&reason=non-english
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+56488&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+56488&report=yes
Search -- http://master.php.net/manage/user-notes.php