Geeks On PHP : Episode 7 – Looping through while, for and foreach

At the heart of every redundant thing you do, is a loop.

Even the greeks knew it.  When Sisyphus pissed off the gods, they stuck him in a while loop

while($gods == “pissed”) {

$sisyphus = “Roll rock up a hill”;

}


Granted the greek gods were a bit tempermental, but like the greeks, your application will execute these types of statements to output data, count, and do all sorts of things that are even, at times, incredibly futile and redundant.  Also like gods, while loops can be tempermental, and when hastily constructed can leave Sisyphus pushing his rock for all of eternity.

Wondering who Sisyphus is ? http://en.wikipedia.org/wiki/Sisyphus

PHP Manual on Control Structures: http://us2.php.net/manual/en/language.control-structures.php

Audio clip: Adobe Flash Player (version 9 or above) is required to play this audio clip. Download the latest version here. You also need to have JavaScript enabled in your browser.

Also, subscribe to us on iTunes and leave us your comments: [ Launch iTunes ]

Follow us on Twitter :
Stephen : http://www.twitter.com/darthweef
Nick : http://www.twitter.com/niczak

Read Users' Comments (1)