Advertisement
bartek27210

iloczyn

Oct 23rd, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.34 KB | None | 0 0
  1. public function iloczyn(){
  2.         $ilosc = count($this->getZbiory());
  3.         $this->wynik = $this->zbiory[0];
  4.        
  5.         for($i=1; $i < $ilosc;$i++)
  6.         {
  7.            $this->wynik = array_intersect($this->wynik, $this->zbiory[$i]);
  8.         }
  9.         $this->wynik = array_values($this->wynik);
  10.         return $this->wynik;  
  11.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement