This shows you the differences between two versions of the page.
user:thakes3:portfolio:php:loopfun4 [2016/03/16 00:12] – created thakes3 | user:thakes3:portfolio:php:loopfun4 [2016/03/16 00:14] (current) – thakes3 | ||
---|---|---|---|
Line 2: | Line 2: | ||
====Synopsis==== | ====Synopsis==== | ||
- | This is the very first time you have witnessed PHP code in action. | + | This code works with the random function to variably change the background color of the table rows generated |
+ | |||
+ | The iteration is different in this application as it uses a static array as an index rather then generated numbers from a loop | ||
====Overview==== | ====Overview==== | ||
There are a few take aways to this code. | There are a few take aways to this code. | ||
- | * The php is embedded | + | * PHP is very powerful |
- | * It can be handled in line with HTML | + | |
- | * It can store data and work with it in the document | + | |
- | + | ||
- | Some things that are less apparent: | + | |
- | * The code is run server side, all the load is happening on the server. | + | |
- | + | ||
- | ====Functions==== | + | |
- | + | ||
- | Functions | + | |
- | + | ||
- | **rand** -- a random number generator. Rand can generate a random integer, and you can pass it a high and low value to work of off. | + | |