PHP Control Structures

To build effective programs, you need control. In this installment on PHP development, you learn to use PHP's control structures.

provided by: 
Originally published at Internet.com


Have you ever stopped to give directions to a lost driver from two states away? For the sake of providing an example, imagine your conversation went something like this:

"Hi, can you tell me how to get to route 50?"
"Sure, just follow this road, turn left onto the expressway, keep driving, and eventually you'll see the exit for route 50." The directions above were linear and sequential: drive on this road, turn here, and then drive until you see the exit. Obviously, they are horrible directions. They don't tell the driver how long to drive on the road before they reach the expressway or that they might want to take a different route to avoid traffic if they tried to leave during rush hour.

If you wanted to give more exact and useful directions, you might say something like:

"Sure, just follow this road for two miles. If its not rush hour, you can take a left at the lights onto the expressway and follow it for another mile until you see the exit for route 50. If you hit it near rush hour, you'll want to avoid the expressway and just follow the road for another 5 miles to route 50." Without Control Structures, PHP would be much like the first set of directions: linear, sequential, and not overly useful...

Read article at Internet.com site
Related Articles
- Creating an App using JScript .NET and Windows Forms
Walk through an application written in JScript .NET that implements a Windows Forms and features menus, a tab strip control, a tree View control, a progress bar, a picture box control, a timer, a calendar control, and much more.
- The Case for Components
- JSP: Creating a Configurable Home Page
- JSP: Creating Dynamic Titles
- The Best Continuous Integration Tools
- Auto repositioning/resizing of child controls (using C++ templates)
- Text Properties
- JSP: Creating Dynamic Forms
- So, You Want A Remote Control, Huh?
- Learning PHP: The What's and the Why's
Regional Articles
- PHP Control Structures Alabama
- PHP Control Structures Alaska
- PHP Control Structures Arizona
- PHP Control Structures Arkansas
- PHP Control Structures California
- PHP Control Structures Colorado
- PHP Control Structures Connecticut
- PHP Control Structures DC
- PHP Control Structures Delaware
- PHP Control Structures Florida
- PHP Control Structures Georgia
- PHP Control Structures Hawaii
- PHP Control Structures Idaho
- PHP Control Structures Illinois
- PHP Control Structures Indiana
- PHP Control Structures Iowa
- PHP Control Structures Kansas
- PHP Control Structures Kentucky
- PHP Control Structures Louisiana
- PHP Control Structures Maine
- PHP Control Structures Maryland
- PHP Control Structures Massachusetts
- PHP Control Structures Michigan
- PHP Control Structures Minnesota
- PHP Control Structures Mississippi
- PHP Control Structures Missouri
- PHP Control Structures Montana
- PHP Control Structures Nebraska
- PHP Control Structures Nevada
- PHP Control Structures New Hampshire
- PHP Control Structures New Jersey
- PHP Control Structures New Mexico
- PHP Control Structures New York
- PHP Control Structures North Carolina
- PHP Control Structures North Dakota
- PHP Control Structures Ohio
- PHP Control Structures Oklahoma
- PHP Control Structures Oregon
- PHP Control Structures Pennsylvania
- PHP Control Structures Rhode Island
- PHP Control Structures South Carolina
- PHP Control Structures South Dakota
- PHP Control Structures Tennessee
- PHP Control Structures Texas
- PHP Control Structures Utah
- PHP Control Structures Vermont
- PHP Control Structures Virginia
- PHP Control Structures Washington
- PHP Control Structures West Virginia
- PHP Control Structures Wisconsin
- PHP Control Structures Wyoming
Related Articles

Rss   Delicious   Digg   Add To My Yahoo   Add To My Google   Bookmark   Search Plugin

Topics:
Architecture & Design Languages & Tools Project Management Web Services
Database Microsoft & .NET Security Wireless
Java Open Source Techniques XML