Thursday, January 22, 2009

The foreach looping construct in one of the less used looping construnct in the programming language, and PHP is not an exception. This is because in PHP, the foreach works only with arrays and will spit an error if used with other data type.

Anyways, using the foreach loop construct is really easy. See example below.