-
What will be the output of the following PHP code?
<?php
$Color = array("Green", "White", "Green", "Red", "Yellow", "White");
print_r(array_count_values($Color));
?>
-
-
Array
(
[Green] => 2
[White] => 2
[Red] => 1
[Yellow] => 1
) -
Array
(
[Green] => 2
[Yellow] => 1
) -
Array
(
[Red] => 1
[Yellow] => 1
) -
Array
(
[Green] => 2
[White] => 2
) - None of these
-
Correct Option: A
The array_count_values() function counts all the values of an array.