Advertisement
VeraKH

Untitled

Dec 4th, 2015
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.39 KB | None | 0 0
  1. $arr1 = [1 , 3, 5, 9, 10, 12 ];
  2. $arr2 = [2 , 4, 5, 7, 2];
  3.  
  4.  
  5. // /* Arrays: finding unique elements from the first array */
  6.  
  7. function FindCommonElements($arr1, $arr2) {
  8.  
  9. $arr1size = count($arr1)-1;
  10. $arr2size = count($arr2)-1;
  11. $temp;
  12.  
  13.     for ($i=0; $i<=$arr1size; $i++){
  14.         $temp = $arr1[$i];
  15.         for ($j=0; $j <= $arr2size;  $j++){
  16.             //code
  17.         }
  18.     }
  19. }
  20.  
  21.  echo FindCommonElements($arr1, $arr2);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement