Return true
if both statements are true:
<?php
if (5 > 3 and 5 < 10) {
echo "true";
} else {
echo "false";
}
?>
Try it Yourself »
The and
keyword is a logical operator.
Logical operators are used to combine conditional statements.
The return value will only be true
if both statements return true
, otherwise it will return false
.
Tip: The difference between and
and &&
is that and
has very low precedence, meaning that most other operations get evaluated first.
Read more about operators in our PHP Operators Tutorial.
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!