-
What will be the output of the following PHP code?
<?php
$First = array("001" => "Ajit", "002" => "Rahul", "003" => "Ats", "004" => "Aju");
$Second = array("005" => "Ajit", "006" => "Rahul", "007" => "Ats", "008" => "Sujit");
$Third = array("009" => "Sujit");
$Forth = array_merge($Second, $Third);
$Result = array_diff($First, $Forth);
print_r($Result);
?>
-
- Error
-
Array
(
[004] => Aju
) - Nothing
-
Array
(
[001] => Aju
) - None of these
Correct Option: B
The array_diff() function compares the values of two (or more) arrays, and returns the differences. This function compares the values of two (or more) arrays, and return an array that contains the entries from array1 that are not present in other arrays (array2, array3, etc).