Talk:PHP Programming/The for Loop

Please do not delete my page randomly, whoever did it. We can just get it back whenever we want. --Spoom 13:58, 6 Oct 2004 (UTC)

Recommendation for better Example code
The last example code is as follows: for($i = 0, $count = count($menu); $i < $count; $i++) { echo($i + 1 . ". " . $menu[$i] . " "); }

Instead I would go for:

for($i = 0; $i < count($menu); $i++) { echo($i + 1 . ". " . $menu[$i] . " "); }

Althought you were trying to show the case that you can write a code inside a For Loop, we need to make sure the people coming and reading this book get the professional view and then when they start writing PHP, they will start with a more professional way.

///Yechie