Tag: php beginner
Understanding Foreach in PHP
by Abu Aisyah on Feb.05, 2010, under Ngoprek, PHP, my notes
This tutorial is an easy way to understand the foreach. Yes, this is for the newbie confused with foreach. Foreach usually used in the variable loops which it has an array value. Array values are such as result from a database, or array value like this.
$ array = array ( ‘January’, ‘February’, ‘March’, ‘April’, ‘April’, ‘June’, ‘July’, ‘August’, ‘September’, ‘October’, ‘November’, ‘ December ‘);
How do these values can occupy each row in a table? Of course the easiest is to use foreach. Although could also use while. But I prefer to use foreach, because the value of the array can we count on. In addition, more cut script when using foreach. (continue reading…)




