array_count_values
(PHP 4 , PHP 5)
array_count_values -- Zählt die Werte eines Arrays
Beschreibung
array
array_count_values ( array input)
array_count_values() gibt ein Array zurück, in
dem die Werte des Arrays input als
Schlüssel, und deren Anzahl als Werte angegeben sind.
Beispiel 1. array_count_values()
<?php $array = array (1, "hello", 1, "world", "hello"); print_r(array_count_values ($array)); ?>
|
Wird folgendes ausgeben:
Array
(
[1] => 2
[hello] => 2
[world] => 1
) |
|