Changes

Jump to: navigation, search

PHP Flow Control and Looping

32 bytes removed, 18:37, 31 May 2007
no edit summary
One of the main reasons for using scripting languages such as PHP is to build logic and intelligence into the creation and deployments of web based data. In ordedr order to be able to build logic into PHP based scripts, it necessary for the script to be able to make decisions and repeast tasks based on specified criteria.
For example , it may be necessary to repeat a section of a script a specified number of times, or perform a task only if one or more conditions are found to be true (i.e only let the user log in if a valid passowrd has been provided).
In programming terms this is known as ''flow control and looping''. In the simplest terms this involves some standard scripting structures provided by languages such as PHP to control the logic and overal behavior of a script. Each of these structures provides a simple and intuitive way to build intelligence into scripts. These PHP structures can be broken down into a number of categories as follows:
'''switch Statements'''
 
'''label Statements'''
 
'''with Statements'''
In this chapter we will explore each of these categories in turn and create some examples that demsonstrate how to implement these mechanisms.

Navigation menu