★ wanayoo — archive 1999 http://www.php.net/manual/hu/function.array-count-values.phpNouvelle recherche | Portail wanayoo

PHP Home Page

Manual Table of Contents
Up to Tömbök
Quick Reference
English version of this pageGerman version of this pageJapanese version of this pageItalian version of this pageFrench version of this page
Tömbök
* array
* array_count_values
* array_diff
* array_flip
* array_intersect
* array_keys
* array_merge
* array_merge_recursive
* array_multisort
* array_pad
* array_pop
* array_push
* array_rand
* array_reverse
* array_shift
* array_slice
* array_splice
* array_unique
* array_unshift
* array_values
* array_walk
* arsort
* asort
* compact
* count
* current
* each
* end
* extract
* in_array
* key
* krsort
* ksort
* list
* next
* pos
* prev
* range
* reset
* rsort
* shuffle
* sizeof
* sort
* uasort
* uksort
* usort
Manual: array_count_values
View the source code for this pageSearch the site



Previous page
 array
 Updated
Sat, 12 Aug 2000
array_diff 
Next page


array_count_values

(PHP4 >= 4.0b4)

array_count_values -- Counts all the values of an array

Description

array array_count_values (array input)

Array_count_values() returns an array using the values of the input array as keys and their frequency in input as values.

Példa 1. Array_count_values() example


$array = array (1, "hello", 1, "world", "hello");
array_count_values ($array); // returns array (1=>2, "hello"=>2, "world"=>1)
      


User Contributed Notes: array_count_values


toms@reservit.com
14-Dec-1999 10:10
In the content, I can't find the function "is_array" in the arrays functions.
If I search it with the quick ref i find it...



dmcgregg@bigfoot.com
17-Dec-1999 09:04
Is anyone else getting this message for array_count_values($somearray) in PHP4B2?

Fatal error: Call to undefined function: array_count_values() in [php_file].php on line [line_number]

Is there something special that needs to be done in order to use this array function?



shevek@anarres.org
15-Feb-2000 10:45
One should theoretically be able to do a unique_array() by
$foo = array_keys(array_count_values($foo));



joe@dtheatre.com
21-Feb-2000 07:32
dmcgregg@bigfoot.com:
The most probable reason for this is that you are not using verson 4.0 take care to read the note especially now that the documentation has been updated for version 4.0



tolborg@nork.auc.dk
02-Mar-2000 07:35
How can this kind of value-count be accomplished in PHP3?


webmaster@battlereports.com
12-Jul-2000 02:00
This can be done in PHP3, but requires quite a few lines of code. Pretty simple though, just use a couple of arrays, one to keep track of the values, one to keep track of the counts.


 About Notes


Previous page
 array
 Updated
Sat, 12 Aug 2000
array_diff 
Next page





Who's responsible for this?
Top of this page

Site
Hosting:



Located in
United States
Elements of this website are subject to copyright.
Questions about installing or using PHP should be directed to one of the mailing lists.
Only questions about the website should be directed to webmaster@php.net.