?
What will be the output of the following PHP code?
What will be the output of the following PHP code?
<?php
$array1 = array ("KA", "LA", "CA", "MA", "TA");
$array2 = array ("KA", "IA", "CA", "GA", "TA");
$inter = array_intersect ($array1, $array2);
print_r ($inter);
?>
<?php
$array1 = array ("KA", "LA", "CA", "MA", "TA");
$array2 = array ("KA", "IA", "CA", "GA", "TA");
$inter = array_intersect ($array1, $array2);
print_r ($inter);
?>
Answer & Solution
Correct Answer:
Option
B
The array_intersect() function returns a key preserved array consisting only of those values present in the first array that are also present in each of the other input arrays.
Join the Discussion
Login to post a comment or share your explanation.
Login