Reply to Re: [PHP] incrementing in a for loop

Your name:

Reply:


Posted by "M. Sokolewicz" on 09/27/85 11:26

Stephen Johnson wrote:
>
> On 9/12/05 12:39 PM, "Peppy" <peppy@foxedge.net> wrote:
>
>
>>for ($i = 1; $i <= 6; $i++) {
>>Is it possible to increment $i by 5?
>
>
> for ($i = 1; $i <= 6; $i+5) {
>
>
that won't work; have you tried it?
Because $i++ assigns the result of $i+1 to $i, while yours does not
assign anything to $i. This means you'll run an eternal loop ;)
to do what you showed, you'll need to change $i+5 to $i=$i+5 or $i += 5

- tul

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация