?
What will be the output of the following PHP code?
What will be the output of the following PHP code?
<?php
$a=array("A","Cat","Dog","A","Dog");
$b=array("A","A","Cat","A","Tiger");
$c=array_combine($a,$b);
print_r(array_count_values($c));
?>
<?php
$a=array("A","Cat","Dog","A","Dog");
$b=array("A","A","Cat","A","Tiger");
$c=array_combine($a,$b);
print_r(array_count_values($c));
?>
Answer & Solution
Correct Answer:
Option
A
The array_count_values() function counts all the values of an array and array_combine() combines arrays.
Join the Discussion
Login to post a comment or share your explanation.
Login[Tiger] => 1
[A] => 2
[Tiger] => 1