Unix and Linux Discussions Tagged with array |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
5 |
53,875 |
Shell Programming and Scripting |
|
|
|
11 |
5,647 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
57,997 |
Shell Programming and Scripting |
|
|
|
4 |
53,451 |
Shell Programming and Scripting |
|
|
|
6 |
2,944 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
2,099 |
UNIX for Beginners Questions & Answers |
|
|
|
15 |
36,014 |
Shell Programming and Scripting |
|
|
|
3 |
23,017 |
Shell Programming and Scripting |
|
|
|
8 |
3,857 |
UNIX for Beginners Questions & Answers |
|
|
|
8 |
7,835 |
Shell Programming and Scripting |
|
|
|
4 |
2,969 |
UNIX for Beginners Questions & Answers |
|
|
|
4 |
2,408 |
UNIX for Beginners Questions & Answers |
|
|
|
11 |
9,065 |
UNIX for Beginners Questions & Answers |
|
|
|
21 |
7,583 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
3,929 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
2,696 |
UNIX for Beginners Questions & Answers |
|
|
|
3 |
6,601 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
1,297 |
UNIX for Beginners Questions & Answers |
|
|
|
5 |
12,944 |
Shell Programming and Scripting |
|
|
|
6 |
7,169 |
Shell Programming and Scripting |
|
|
|
3 |
18,387 |
AIX |
|
|
|
3 |
2,812 |
UNIX for Beginners Questions & Answers |
|
|
|
8 |
3,420 |
UNIX for Beginners Questions & Answers |
|
|
|
10 |
10,612 |
Shell Programming and Scripting |
|
|
|
3 |
2,277 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
19,882 |
AIX |
|
|
|
6 |
18,178 |
Homework & Coursework Questions |
|
|
|
3 |
5,367 |
Shell Programming and Scripting |
|
|
|
3 |
1,196 |
UNIX for Beginners Questions & Answers |
|
|
|
8 |
5,252 |
Shell Programming and Scripting |
|
|
|
29 |
5,307 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
2,311 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
4,652 |
Shell Programming and Scripting |
|
|
|
12 |
6,861 |
Shell Programming and Scripting |
|
|
|
2 |
1,485 |
Shell Programming and Scripting |
|
|
|
17 |
2,944 |
UNIX for Beginners Questions & Answers |
|
|
|
6 |
4,661 |
What is on Your Mind? |
|
|
|
6 |
2,766 |
Shell Programming and Scripting |
|
|
|
8 |
9,961 |
Shell Programming and Scripting |
|
|
|
9 |
2,422 |
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)