Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- a[0]={1,2,3};
- a[1]={2,3,4};
- **Edit** in a[2] from a[2]={4,5};
- a[2]={2,4,5};
- and more
- call_user_func_array('array_intersect',$a);
- $intersect = $a[0];
- for ($i = 1; $i < count($a); $i++)
- {
- $intersect = array_intersect($intersect, $a[$i]);
- }
- <?php
- $array1 = array("a" => "green", "red", "blue");
- $array2 = array("b" => "green", "yellow", "red");
- $result = array_intersect($array1, $array2);
- print_r($result);
- ?>
- Array
- (
- [a] => green
- [0] => red
- )
Add Comment
Please, Sign In to add comment