PHP Fibonacci Numbers
In maths, the sequence Fn of Fibonacci numbers is defined by the recurrence relation. The Fibonacci numbers are the numbers in the following integer sequence: 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144...
<?php
$first = 0;
$second = 1;
$n = 50;
print $first . '<br>';
print $second . '<br>';
for ($i = 1; $i <= $n -1; $i++)
{
$final = $first + $second;
$first = $second;
$second = $final;
print $final . '<br>';
}
?>