Unix and Linux Discussions Tagged with array |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
5 |
5,844 |
Shell Programming and Scripting |
|
|
|
11 |
3,529 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
4,111 |
Shell Programming and Scripting |
|
|
|
4 |
7,268 |
Shell Programming and Scripting |
|
|
|
6 |
1,672 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
1,183 |
UNIX for Beginners Questions & Answers |
|
|
|
15 |
15,302 |
Shell Programming and Scripting |
|
|
|
3 |
15,333 |
Shell Programming and Scripting |
|
|
|
8 |
1,746 |
UNIX for Beginners Questions & Answers |
|
|
|
8 |
2,612 |
Shell Programming and Scripting |
|
|
|
4 |
1,641 |
UNIX for Beginners Questions & Answers |
|
|
|
4 |
1,675 |
UNIX for Beginners Questions & Answers |
|
|
|
11 |
4,185 |
UNIX for Beginners Questions & Answers |
|
|
|
21 |
3,150 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
1,659 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
1,905 |
UNIX for Beginners Questions & Answers |
|
|
|
3 |
2,137 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
721 |
UNIX for Beginners Questions & Answers |
|
|
|
5 |
6,213 |
Shell Programming and Scripting |
|
|
|
6 |
4,137 |
Shell Programming and Scripting |
|
|
|
3 |
14,574 |
AIX |
|
|
|
3 |
2,106 |
UNIX for Beginners Questions & Answers |
|
|
|
8 |
1,040 |
UNIX for Beginners Questions & Answers |
|
|
|
10 |
4,518 |
Shell Programming and Scripting |
|
|
|
3 |
1,704 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
14,433 |
AIX |
|
|
|
6 |
10,415 |
Homework & Coursework Questions |
|
|
|
3 |
4,391 |
Shell Programming and Scripting |
|
|
|
3 |
650 |
UNIX for Beginners Questions & Answers |
|
|
|
8 |
1,659 |
Shell Programming and Scripting |
|
|
|
29 |
2,058 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
1,366 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
1,185 |
Shell Programming and Scripting |
|
|
|
12 |
1,447 |
Shell Programming and Scripting |
|
|
|
2 |
720 |
Shell Programming and Scripting |
|
|
|
17 |
1,394 |
UNIX for Beginners Questions & Answers |
|
|
|
6 |
3,523 |
What is on Your Mind? |
|
|
|
6 |
1,076 |
Shell Programming and Scripting |
|
|
|
8 |
3,363 |
Shell Programming and Scripting |
|
|
|
9 |
1,007 |
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)