note 25850 deleted from function.count by philip

From: Date: Fri, 13 Dec 2002 00:19:58 +0000
Subject: note 25850 deleted from function.count by philip
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-40829@lists.php.net to get a copy of this message
If you actually want to count the numbers in the following example... $a[0] = 1; $a[1] = 3; $a[2] = 5; $result = count ($a); // $result == 3 Then you can use this function I whipped up function count_vals_in_array($array){ $n=0; while(list($i) = each($array)){ $n=$n + $array[$i]; } return $n; } count_vals_in_array($a); //returns 9

« previous php.notes (#40829) next »