note 34166 added to function.count

From: Date: Thu, 17 Jul 2003 13:34:17 +0000
Subject: note 34166 added to function.count
Groups: php.notes 
Request: Send a blank email to php-notes+get-52274@lists.php.net to get a copy of this message
count() has a second argument not listed here, [int mode], that will count the array recursively. $arr = array(range(1,10),'string'); echo count($arr,true); == 12 echo count($arr,false); == 2 There seems to be no limit on how deep this will recurse. This option was added in version 4.2.0. ---- Manual Page -- http://www.php.net/manual/en/function.count.php Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+34166 Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+34166&report=yes Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+34166&report=yes

« previous php.notes (#52274) next »