What will be the output of the following PHP code?
<?php
$a1 = array(“a” => “red”, “b” => “green”, “c” => “blue”, “d” => “yellow”);
$a2 = array(“e” => “red”,”f” => “green”, “g” => “blue”);
$result = array_intersect($a1, $a2);
print_r($result);
?>
a)  Array ( [a] => red [b] => green [c] => blue )
b)	Array ( [a] => red [b] => green [c] => blue [d] => yellow )
c)	Array ( [e] => red [f] => green [g] => blue )
d)	Array ( [a] => red [b] => green [c] => blue [d] => yellow [e] => red [f] => green [g] => blue )
Answer: a
Explanation: The function array_intersect() compares the values of two (or more) arrays, and returns the matches. So, in the above program values of a1 and a2 will be compared and the values present in both the arrays will be the returned.
						
						
												
							Related Posts
- Empdt1(empcode, name, street, city, state, pincode).
 For any pincode, there is only one city and state. Also, for given street, city and state, there is just one pincode. In normalization terms, empdt1 is a relation in
- Which forms are based on the concept of functional dependency:
- Which forms has a relation that possesses data about an individual entity:
- Which forms simplifies and ensures that there are minimal data aggregates and repetitive groups:
- Which is a bottom-up approach to database design that design by examining the relationship between attributes:
- Functional Dependencies are the types of constraints that are based on______
- Which-one ofthe following statements about normal forms is FALSE?
Join The Discussion