Php uses non-recursive methods to process the Fibonacci series. I have come up with my own ideas. In fact, it is an offset to solve this problem by using a program. First, let's look at the series: the next number in the series 1, 1, 2, 3, 5, 8, 13, 21, and 34 is the first two, in fact, the program solves this problem, which is an offset problem. First, let's look at the series: the next number in series 1, 1, 2, 3, 5, 8, 13, 21, and 34 is the sum of the first two numbers, and so on.
The program is actually a FOR statement. The traditional FOR statement is for ($ I = 1; $ I; $ count, $ I ++ ), the offset here is $ I = $ I + 1. if the number of rows is processed, the offset is not 1, which is the first number. When you are for, one variable records the previous number, and the other records the current number. The offset is the previous number, and then the value is assigned again in the loop, record the previous number as a loop value of course to offset the next loop. The code is actually very simple:
The code is as follows:
$ Count = 9999999999967543;
$ Array = array ('0' => 1 );
For ($ a = 1, $ I = 2; $ I <$ count; $ I = $ I + $ ){
$ Array [] = $;
$ Array [] = $ I;
$ A = $ a + $ I;
}
Print_r ($ array );
Echo $ count. 'contains'. count ($ array). 'number of Fibonacci series ';
Which of the following boring people is recommended to use phpchina to top up Chinese cabbage jobs?
Bytes. First, let's look at the series: the next number of series 1, 1, 2, 3, 5, 8, 13, 21, and 34 is the first two...