Fibonacci Mathematical Sequence Programmed in PHP
Have you been looking for a way to represent the Fibonacci Sequence in PHP, well here they are.
Please be careful when using the functions provided on my website, as if misused they can cause unwanted performance issues with your sever / computer.
The four functions that I provide to you have different ways of representing the same thing.
The first function outputs a multi-dimensional array, without using recursion, so your final output will be something like "$ current_Number => $ fibonacci_Num".
The second function does the same thing, but cleans the output to where it is just a normal array, so all you will have is the "$ fibonacci_Number". This is not really a function, but a for loop.
The third function uses recursion, but relationships on an explicit formula.
The forth function is just a for loop, so nothing special.
Now would I use one over the other, not likely. All of the functions do the same thing, and to my knowledge, each work at the same speed.
All of the formula's that are provided can be used for any purpose. You can show it off to your friends, or use it to make a list for graph the Golden Ratio. There are many uses for the Fibonacci Sequence, and if you would like to know more, please view the Wikipedia page for Fobonacci's Sequence.
If you are looking for some web hosting to practice with PHP, I personally recommend BlueHost.
If you would like to download the source code for the Fibonacci Sequence in PHP, please visit http://tylerperroux.com/fibonacci-sequence-in-php.html .