note 19250 added to function.count
| From: | hst at syd dot kth dot se | Date: | Wed, 20 Feb 2002 23:47:56 +0000 |
| Subject: | note 19250 added to function.count | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-26867@lists.php.net to get a copy of this message | ||
If your goal is not to get the "size" of an array but to find out if it is empty. This
should, by principal, be faster.(not done any timing tests). Since this do not require any
itterations.
$stack = array();
array_push ( $stack, "1" );
array_push ( $stack, "2" );
while ( $stack != array() )
{
print array_pop ( $stack );
}
--
http://www.php.net/manual/en/function.count.php
http://master.php.net/manage/user-notes.php?action=edit+19250
http://master.php.net/manage/user-notes.php?action=delete+19250
http://master.php.net/manage/user-notes.php?action=reject+19250