Contact: aviboots(AT)netvision.net.il
39,975 questions
51,919 answers
573 users
function printFibonacciNumbers($N) { $n1 = 0; $n2 = 1; if ($N < 1) return; echo $n1 . " "; for ($i = 1; $i < $N; $i++) { echo $n2 . " "; $next = $n1 + $n2; $n1 = $n2; $n2 = $next; } } printFibonacciNumbers(10); /* run: 0 1 1 2 3 5 8 13 21 34 */