Run some code when a condition is not met:
<?php
if (5 < 3) {
echo "Five is less than three";
} else {
echo "Five is not less than three";
}
?>
Try it Yourself »
The else
keyword specifies a block of code which should run when the condition of an if statement is not met.
The if
keyword.
The elseif
keyword.
Read more about the if...elseif...else conditional in our PHP if else Tutorial.
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!