I thought about it myself. Actually ProgramTo solve this problem, it 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. CodeIt is actually very simple:
Copy codeThe 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?