Unix and Linux Discussions Tagged with array |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
5 |
8,134 |
Shell Programming and Scripting |
|
|
|
11 |
4,024 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
5,803 |
Shell Programming and Scripting |
|
|
|
4 |
8,935 |
Shell Programming and Scripting |
|
|
|
6 |
2,052 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
1,480 |
UNIX for Beginners Questions & Answers |
|
|
|
15 |
21,763 |
Shell Programming and Scripting |
|
|
|
3 |
17,139 |
Shell Programming and Scripting |
|
|
|
8 |
2,258 |
UNIX for Beginners Questions & Answers |
|
|
|
8 |
3,186 |
Shell Programming and Scripting |
|
|
|
4 |
2,041 |
UNIX for Beginners Questions & Answers |
|
|
|
4 |
1,938 |
UNIX for Beginners Questions & Answers |
|
|
|
11 |
6,156 |
UNIX for Beginners Questions & Answers |
|
|
|
21 |
4,042 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
2,361 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
2,130 |
UNIX for Beginners Questions & Answers |
|
|
|
3 |
3,212 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
943 |
UNIX for Beginners Questions & Answers |
|
|
|
5 |
7,432 |
Shell Programming and Scripting |
|
|
|
6 |
4,529 |
Shell Programming and Scripting |
|
|
|
3 |
15,553 |
AIX |
|
|
|
3 |
2,319 |
UNIX for Beginners Questions & Answers |
|
|
|
8 |
1,690 |
UNIX for Beginners Questions & Answers |
|
|
|
10 |
5,352 |
Shell Programming and Scripting |
|
|
|
3 |
1,858 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
16,399 |
AIX |
|
|
|
6 |
13,880 |
Homework & Coursework Questions |
|
|
|
3 |
4,684 |
Shell Programming and Scripting |
|
|
|
3 |
851 |
UNIX for Beginners Questions & Answers |
|
|
|
8 |
2,848 |
Shell Programming and Scripting |
|
|
|
29 |
3,188 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
1,645 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
2,010 |
Shell Programming and Scripting |
|
|
|
12 |
2,083 |
Shell Programming and Scripting |
|
|
|
2 |
932 |
Shell Programming and Scripting |
|
|
|
17 |
2,005 |
UNIX for Beginners Questions & Answers |
|
|
|
6 |
3,843 |
What is on Your Mind? |
|
|
|
6 |
1,682 |
Shell Programming and Scripting |
|
|
|
8 |
6,132 |
Shell Programming and Scripting |
|
|
|
9 |
1,407 |
Shell Programming and Scripting |
ARRAY_COUNT_VALUES(3) 1 ARRAY_COUNT_VALUES(3)
array_count_values - Counts all the values of an array
SYNOPSIS
array array_count_values (array $array)
DESCRIPTION
array_count_values(3) returns an array using the values of $array as keys and their frequency in $array as values.
PARAMETERS
o $array
- The array of values to count
RETURN VALUES
Returns an associative array of values from $array as keys and their count as value.
ERRORS
/EXCEPTIONS
Throws E_WARNING for every element which is not string or integer.
EXAMPLES
Example #1
array_count_values(3) example
<?php
$array = array(1, "hello", 1, "world", "hello");
print_r(array_count_values($array));
?>
The above example will output:
Array
(
[1] => 2
[hello] => 2
[world] => 1
)
SEE ALSO
count(3), array_unique(3), array_values(3), count_chars(3).
PHP Documentation Group ARRAY_COUNT_VALUES(3)