Fibonacci Series print the values of the value of current and previous value of the natural numbers it is look like 0 1 1 2 3 5 8 13 it is the linear sequence of the integers these all values follow the the mathematical logic is Fn+1 = Fn + Fn-1
<?php
// DEFINE $i for INITILIZATION
$i = 1;
// DEFINE $a FOR THE STARTING LOOP VALUE
$a = 0;
// DEFINE $b FOR SECON HELPER VALUE
$b = 1;
// START LOOP TO PRINT VALUE
// CONDITION WILL PRINT ONLY 20 VALUES
// LOOP WILL RUN ONLY 20 TIMES
while($i<=20)
{
// LOOP WILL PRINT THE VALUES HERE
// CONCATINATION SPACE TO DIFFERENCIATE THE VALUES
echo $a . " "; // 0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181
// $c IS HELPER VARIABLE STORE THE THIS AND NEXT VALUE
$c = $a + $b; // 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181 6765 10946
// ASSIGN NEXT VALUE TO THE $a
$a = $b; // 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181 6765
// ASSIGN THE VALUE OF $C(SUM OF THIS AND NEXT VALUE) TO $B
$b = $c; // 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181 6765 10946
// INCREMENT FOR LOOP
$i++; // 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
}
?>