note 34965 deleted from function.array-sum by googleguy

From: Date: Tue, 22 Oct 2013 06:51:42 +0000
Subject: note 34965 deleted from function.array-sum by googleguy
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-196677@lists.php.net to get a copy of this message
Note Submitter: mcrm at NOTNEEDIT dot freemal dot it ---- Hi people, if someone is searching a function that works also with multimension array, i suggest this : <?php function cw_array_count($a) { if(!is_array($a)) return $a; foreach($a as $key=>$value) $totale += cw_array_count($value); return $totale; } $a[0][E][PS][P][a1]=1; $a[0][E][PS][P][a2]=2; $a[0][E][PJ][P][a2]=2; $a[1][E][PS][E][a3]=3; echo cw_array_count($a[0]); // or echo cw_array_count($a[0][E]); ?> Bye, Bye. R.Martina

« previous php.notes (#196677) next »