PHP else 关键词
定义和用法
else 关键字指定当 if 语句的条件不满足时应运行的代码块。
实例
当条件不满足时运行一些代码:
<?php
if (5 < 3) {
echo "Five is less than three";
} else {
echo "Five is not less than three";
}
?>
else 关键字指定当 if 语句的条件不满足时应运行的代码块。
当条件不满足时运行一些代码:
<?php
if (5 < 3) {
echo "Five is less than three";
} else {
echo "Five is not less than three";
}
?>