Star Hoster
Photoshop Tutorials
Anonymous Web Surfing
Funny Jokes
Myspace Friends
Open Treasure Chest
Building in Paradise


December 1, 2005

PHP For Each Loop

Filed under: Intro PHP Tutorials — Administrator @ 12:29 am

For Each Loop

Imagine that you have an associative array that you want to iterate through. PHP provides an easy way to use every element of an array with the Foreach statement.

In plain english this statement will do the following:

For each item in the specified array execute this code. (more…)

PHP For Loop

Filed under: Intro PHP Tutorials — Administrator @ 12:26 am

For Loop

The for loop is simply a while loop with a bit more code added to it. The common tasks that are covered by a for loop are:

1. Set a counter variable to some initial value.

2. Check to see if the conditional statement is true.

3. Execute the code within the loop.

4. Increment a counter at the end of each iteration through the loop. (more…)

PHP While Loop

Filed under: Intro PHP Tutorials — Administrator @ 12:11 am

While Loop

Repetitive tasks are always a burden. The nice thing about programming is that you can avoid repetitive tasks with a little bit of extra thinking. Most often these repetitive tasks are conquered in the loop.

The idea of a loop is to do something over and over again until the task has been completed. Before we show a real example of when you might need one, let’s go over the structure of the PHP while loop. (more…)