else

经常需要在满足某个条件时执行一条语句,而在不满足该条件时执行其它语句,这正是 else 的功能。 else 延伸了 if 语句,可以在 if 语句中的表达式的值为 false 时执行语句。

<?php

if (isset($foo)) {
    //
} else {
    //
}

results matching ""

    No results matching ""