note 61118 added to function.count
| From: | anil dot iitk at gmail dot com | Date: | Thu, 26 Jan 2006 08:32:58 +0000 |
| Subject: | note 61118 added to function.count | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-102463@lists.php.net to get a copy of this message | ||
<?php
$food = array('fruits' => array('orange', 'banana',
'apple'),
'veggie' => array('carrot', 'collard',
'pea'));
// recursive count
echo "<br>".count($food, COUNT_RECURSIVE); // output 8
function average($a){
return array_sum($a)/count($a) ;
}
$b = array(1,2,3,4,5,6,7,8,9);
echo "Average of array:".average($b);
?>
----
Server IP: 64.246.30.37
Probable Submitter: 203.200.95.130 (proxied: 172.26.77.229)
----
Manual Page -- http://www.php.net/manual/en/function.count.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+61118
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+61118&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+61118&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+61118&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+61118&report=yes&reason=useless
Delete: non-english -- http://master.php.net/manage/user-notes.php?action=delete+61118&report=yes&reason=non-english
Delete: already in docs -- http://master.php.net/manage/user-notes.php?action=delete+61118&report=yes&reason=already+in+docs
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+61118&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+61118&report=yes
Search -- http://master.php.net/manage/user-notes.php