note 75839 added to function.array-count-values
| From: | majerm at gmail dot com | Date: | Mon, 18 Jun 2007 14:50:30 +0000 |
| Subject: | note 75839 added to function.array-count-values | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-127536@lists.php.net to get a copy of this message | ||
<?
function array_icount_values($array) {
$ret_array = array();
foreach($array as $value) $ret_array[strtolower($value)]++;
return $ret_array;
}
$ar = array('J. Karjalainen', 'J. Karjalainen', 60, '60', 'J.
Karjalainen', 'j. karjalainen', 'Fastway', 'FASTWAY',
'Fastway', 'fastway', 'YUP');
$ar = array_icount_values($ar);
?>
this prints:
Array
(
[j. karjalainen] => 4
[60] => 2
[fastway] => 4
[yup] => 1
)
----
Server IP: 212.24.129.51
Probable Submitter: 62.84.145.14
----
Manual Page -- http://www.php.net/manual/en/function.array-count-values.php
Edit -- https://master.php.net/note/edit/75839
Del: integrated -- https://master.php.net/note/delete/75839/integrated
Del: useless -- https://master.php.net/note/delete/75839/useless
Del: bad code -- https://master.php.net/note/delete/75839/bad+code
Del: spam -- https://master.php.net/note/delete/75839/spam
Del: non-english -- https://master.php.net/note/delete/75839/non-english
Del: in docs -- https://master.php.net/note/delete/75839/in+docs
Del: other reasons-- https://master.php.net/note/delete/75839
Reject -- https://master.php.net/note/reject/75839
Search -- https://master.php.net/manage/user-notes.php