else

创建于 2024-12-03 / 27
字体: [默认] [大] [更大]

❮ PHP 关键字

实例

当条件满足时运行一些代码:

<?php
if (5 < 3) {
  echo "Five is less than three";
} else {
  echo "Five is not less than three";
}
?> 亲自试一试 »

定义和用法

else 关键字指定当 if 语句的条件不满足时应该运行的代码块。


相关页面

if关键字。

elseif关键字。

在我们的 PHP if else 教程中了解有关 if...elseif...else 条件的更多信息。


❮ PHP 关键字
0 人点赞过