Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

CodeWalkers:
An Intro to Control Structures
Apr 09, 2003 @ 12:26:33

From CodeWalkers.com this morning, there's a new tutorial for those out there just starting out with PHP and need a little help with conditional statements.

For those just learning the language (or just learning how to program period), this article can help you understand exactly how ifs, switches, while, do, and for loops work. They also give you some pretty good examples of how to use each one with some sample code, and when each can be the most effective. I'm even impressed that they mentioned the "ternary operator" way of doing ifs, which can save you fingers a lot of typing, and your code a few lines.

While I wouldn't recommend this tutorial for anyone but the beginners out there, it is a good starting place for using these powerful control structures in your code.

tagged:

Link:


Trending Topics: