Книга: Fedora™ Unleashed, 2008 edition

for

for

The for construct performs a statement (block of code) for a set of conditions defined as follows:

for (start condition; end condition; increment function) {
 statement(s)
}

The start condition is set at the beginning of the loop. Each time the loop is executed, the increment function is performed until the end condition is achieved. This looks much like the traditional for/next loop. The following code is an example of a for loop:

for ($i=1; $i<=10; $i++) {
 print "$in"
}

Оглавление книги

Оглавление статьи/книги

Генерация: 0.077. Запросов К БД/Cache: 2 / 0
поделиться
Вверх Вниз