Add Favorites | Set Homepage | RSS
Navigation: 首页 > Web > Web Development

Fibonacci Mathematical Sequence Programmed in PHP

Time:2010-02-11 17:52:14  Source:Ezinearticles  Author:Tyler Perroux

Have you been looking for a way to represent the Fibonacci Sequence in PHP, well here they are.X5VFree Articles Directory | Hostsee.com

Please be careful when using the functions provided on my website, as if misused they can cause unwanted performance issues with your sever/computer.X5VFree Articles Directory | Hostsee.com

The four functions that I provide to you have different ways of representing the same thing.X5VFree Articles Directory | Hostsee.com

The first function outputs a multi-dimensional array, without using recursion, so your final output will be something like "$current_Number => $fibonacci_Num".X5VFree Articles Directory | Hostsee.com

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 isn't really a function, but a for loop.X5VFree Articles Directory | Hostsee.com

The third function uses recursion, but relies on an explicit formula.X5VFree Articles Directory | Hostsee.com

The forth function is just a for loop, so nothing special.X5VFree Articles Directory | Hostsee.com

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.X5VFree Articles Directory | Hostsee.com

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.X5VFree Articles Directory | Hostsee.com

If you are looking for some web hosting to practice with PHP, I personally recommend BlueHost.X5VFree Articles Directory | Hostsee.com

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.X5VFree Articles Directory | Hostsee.com

Tyler Perroux
http://TylerPerroux.comX5VFree Articles Directory | Hostsee.com

Article Source: http://EzineArticles.com/?expert=Tyler_Perroux X5VFree Articles Directory | Hostsee.com

Prev:How to Select the Best Social Networking Script For Your Website - Setting Requirements
Next:Free Open Source, Professional Websites Eradicate the Need For Development and Programming Entirely

Digg
Home
Home
Speak Your Mind comment
User Name: Password:
Verification Code: Anonymous
Partners
Related Posts
Recent Posts
Hot Posts