Witam,
Czy ktoś ma jakiś ciekawy pomysł na samoaktualizującą się stopkę w szablonie? Najprościej jest dać bezpośredni readfile, ale to głupi pomysł.
class Admin_File_Random{ private $x; private $max; private $g=75; private $n=65537; public function __construct($seed,$max){ $this->x=bcmod($seed,$this->n); $this->max=$max; } $y=$this->g*$this->x; $this->x=bcmod($y,$this->n); } public function randHow($ile){ if($ile>$this->max) { throw new Exception('Liczba wylosowanych liczb przekracza liczbe maksymalna'); } $d = "0"; for($i="1"; $i<=$ile; $i++) { $y[$i]=($this->g+$i*10)*$this->x; $this->x=bcmod($y[$i],$this->n); { $i--; $this->g = $this->g + 1; $this->n = $this->n + 3; } else { $tabRand[] = $number; } } return $tabRand; } }