ExamVeda
Login
Home
This question belongs to PHP Arrays
Arrays
?

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);
?>

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.
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.