Javatpoint Logo
Javatpoint Logo

Fibonacci Series

Fibonacci series is the one in which you will get your next term by adding previous two numbers.

For example,

and so on.


  • Initializing first and second number as 0 and 1.
  • Print first and second number.
  • From next number, start your loop. So third number will be the sum of the first two numbers.


We'll show an example to print the first 12 numbers of a Fibonacci series.


PHP Fibonacci series 1

Fibonacci series using Recursive function

Recursion is a phenomenon in which the recursion function calls itself until the base condition is reached.


PHP Fibonacci series 2
Next TopicReverse number

Youtube For Videos Join Our Youtube Channel: Join Now

Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA