Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $arr1 = [1 , 3, 5, 9, 10, 12 ];
- $arr2 = [2 , 4, 5, 7, 2];
- // /* Arrays: finding unique elements from the first array */
- function FindCommonElements($arr1, $arr2) {
- $arr1size = count($arr1)-1;
- $arr2size = count($arr2)-1;
- $temp;
- for ($i=0; $i<=$arr1size; $i++){
- $temp = $arr1[$i];
- for ($j=0; $j <= $arr2size; $j++){
- //code
- }
- }
- }
- echo FindCommonElements($arr1, $arr2);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement