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

О проекте

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

MySQL

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

Хостинг

Другое








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

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

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

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

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

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

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

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

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

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

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

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



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





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

elseif

elseif, as its name suggests, is a combination of if and else. Like else, it extends an if statement to execute a different statement in case the original if expression evaluates to FALSE. However, unlike else, it will execute that alternative expression only if the elseif conditional expression evaluates to TRUE. For example, the following code would display a is bigger than b, a equal to b or a is smaller than b:

<?php
if ($a > $b) {
    echo
"a is bigger than b";
} elseif (
$a == $b) {
    echo
"a is equal to b";
} else {
    echo
"a is smaller than b";
}
?>

There may be several elseifs within the same if statement. The first elseif expression (if any) that evaluates to TRUE would be executed. In PHP, you can also write 'else if' (in two words) and the behavior would be identical to the one of 'elseif' (in a single word). The syntactic meaning is slightly different (if you're familiar with C, this is the same behavior) but the bottom line is that both would result in exactly the same behavior.

The elseif statement is only executed if the preceding if expression and any preceding elseif expressions evaluated to FALSE, and the current elseif expression evaluated to TRUE.


Пред. Начало След.
else Уровень выше Alternative syntax for control structures


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





Copyright © 2005-2016 Project.Net.Ru