What Will Be The Output Of The Following Php Codep Pre Langphp #43
What will be the output of the following PHP code?</p> <pre><code class="language-php" line="1"> <?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)); ?> </code></pre>
This multiple choice question (MCQ) is related to the book/course gs gs107 PHP: Hypertext Preprocessor. It can also be found in gs gs107 PHP Array - PHP Array - Quiz No.2.
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)); ?>
Array ( [A] => 5 [Cat] => 2 [Dog] => 2 [Tiger] => 1 )
Array ( [A] => 2 [Cat] => 2 [Dog] => 1 [Tiger] => 1 )
Array ( [A] => 6 [Cat] => 1 [Dog] => 2 [Tiger] => 1 )
Array ( [A] => 2 [Tiger] => 1 )