&lt;?php$a = array&#40;&quot;A&quot;, &quot;Cat&quot;, &quot;Dog&quot;, &quot;A&quot;, &quot;Dog&quot;&#41;;print_r&#40;array_count_values&#40;$a&#41;&#41;;?&gt;
A. Array ( [A] => 2 [Cat] => 1 [Dog] => 2 )
B. Array ( [A] => 2 [Cat] => 2 [Dog] => 1 )
C. Array ( [A] => 1 [Cat] => 1 [Dog] => 2 )
D. Array ( [A] => 2 [Cat] => 1 [Dog] => 1)
Answer:A
&lt;?php$a = array&#40;&quot;A&quot;, &quot;Cat&quot;, &quot;Dog&quot;, &quot;A&quot;, &quot;Dog&quot;&#41;;print_r&#40;array_count_values&#40;$a&#41;&#41;;?&gt;
A. Array ( [A] => 2 [Cat] => 1 [Dog] => 2 ) B. Array ( [A] => 2 [Cat] => 2 [Dog] => 1 ) C. Array ( [A] => 1 [Cat] => 1 [Dog] => 2 ) D. Array ( [A] => 2 [Cat] => 1 [Dog] => 1)
Explanation: The array_count_values() function counts all the values of an array.