Unix and Linux Discussions Tagged with array |
|
Thread / Thread Starter |
Last Post |
Replies |
Views |
Forum |
|
|
|
5 |
63,316 |
Shell Programming and Scripting |
|
|
|
11 |
9,307 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
67,976 |
Shell Programming and Scripting |
|
|
|
4 |
62,583 |
Shell Programming and Scripting |
|
|
|
6 |
5,248 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
4,115 |
UNIX for Beginners Questions & Answers |
|
|
|
15 |
42,559 |
Shell Programming and Scripting |
|
|
|
3 |
28,024 |
Shell Programming and Scripting |
|
|
|
8 |
7,437 |
UNIX for Beginners Questions & Answers |
|
|
|
8 |
10,415 |
Shell Programming and Scripting |
|
|
|
4 |
4,638 |
UNIX for Beginners Questions & Answers |
|
|
|
4 |
3,816 |
UNIX for Beginners Questions & Answers |
|
|
|
11 |
14,342 |
UNIX for Beginners Questions & Answers |
|
|
|
21 |
14,415 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
5,952 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
4,260 |
UNIX for Beginners Questions & Answers |
|
|
|
3 |
8,937 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
2,697 |
UNIX for Beginners Questions & Answers |
|
|
|
5 |
16,252 |
Shell Programming and Scripting |
|
|
|
6 |
8,994 |
Shell Programming and Scripting |
|
|
|
3 |
21,380 |
AIX |
|
|
|
3 |
4,037 |
UNIX for Beginners Questions & Answers |
|
|
|
8 |
6,189 |
UNIX for Beginners Questions & Answers |
|
|
|
10 |
13,956 |
Shell Programming and Scripting |
|
|
|
3 |
3,322 |
UNIX for Beginners Questions & Answers |
|
|
|
2 |
22,963 |
AIX |
|
|
|
6 |
21,909 |
Homework & Coursework Questions |
|
|
|
3 |
6,523 |
Shell Programming and Scripting |
|
|
|
3 |
2,296 |
UNIX for Beginners Questions & Answers |
|
|
|
8 |
7,279 |
Shell Programming and Scripting |
|
|
|
29 |
10,616 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
3,815 |
UNIX for Beginners Questions & Answers |
|
|
|
1 |
6,000 |
Shell Programming and Scripting |
|
|
|
12 |
8,918 |
Shell Programming and Scripting |
|
|
|
2 |
2,206 |
Shell Programming and Scripting |
|
|
|
17 |
5,701 |
UNIX for Beginners Questions & Answers |
|
|
|
6 |
7,082 |
What is on Your Mind? |
|
|
|
6 |
3,886 |
Shell Programming and Scripting |
|
|
|
8 |
12,651 |
Shell Programming and Scripting |
|
|
|
9 |
3,315 |
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)