П О Р Т А Л                            
С Е Т Е В Ы Х                          
П Р О Е К Т О В                        
  
Поиск по сайту:
                                                 
Главная

О проекте

Web-мастеру
     HTML & JavaScript
     SSI
     Perl
     PHP
     XML & XSLT
     Unix Shell

MySQL

Безопасность

Хостинг

Другое








Самое читаемое:

Учебник PHP - "Для Чайника".
Просмотров 3597 раз(а).

Иллюстрированный самоучитель по созданию сайтов.
Просмотров 6185 раз(а).

Учебник HTML.
Просмотров 3317 раз(а).

Руководство по PHP5.
Просмотров 5555 раз(а).

Хостинг через призму DNS.
Просмотров 4219 раз(а).

Подборка текстов стандартных документов.
Просмотров 55814 раз(а).

Учебник PHP - Самоучитель
Просмотров 3149 раз(а).

Документация на MySQL (учебник & справочное руководство)
Просмотров 6313 раз(а).

Внешние атаки...
Просмотров 3897 раз(а).

Учебник PHP.
Просмотров 2860 раз(а).

SSI в примерах.
Просмотров 37494 раз(а).



 
 
| Добавить в избранное | Сделать стартовой | Помощь





Руководство по PHP
Пред. Глава 16. Control Structures След.

continue

continue is used within looping structures to skip the rest of the current loop iteration and continue execution at the condition evaluation and then the beginning of the next iteration.

Замечание: Note that in PHP the switch statement is considered a looping structure for the purposes of continue.

continue accepts an optional numeric argument which tells it how many levels of enclosing loops it should skip to the end of.

<?php
while (list($key, $value) = each($arr)) {
    if (!(
$key % 2)) { // skip odd members
        
continue;
    }
    
do_something_odd($value);
}

$i = 0;
while (
$i++ < 5) {
    echo
"Outer<br />\n";
    while (
1) {
        echo
"&nbsp;&nbsp;Middle<br />\n";
        while (
1) {
            echo
"&nbsp;&nbsp;Inner<br />\n";
            continue
3;
        }
        echo
"This never gets output.<br />\n";
    }
    echo
"Neither does this.<br />\n";
}
?>

Omitting the semicolon after continue can lead to confusion. Here's an example of what you shouldn't do.

<?php
  
for ($i = 0; $i < 5; ++$i) {
      if (
$i == 2)
          continue
      print
"$i\n";
  }
?>

One can expect the result to be :

0
1
3
4

but this script will output :

2

because the return value of the print() call is int(1), and it will look like the optional numeric argument mentioned above.



Если Вы не нашли что искали, то рекомендую воспользоваться поиском по сайту:
 





Copyright © 2005-2016 Project.Net.Ru