
For now, focus on the && (and) and || (or) operators to determine the validity of a few comparisons.
Example:
<HTML>
<HEAD>
<TITLE>Using Logical Operators</TITLE>
</HEAD>
<BODY>
<?
$degrees = “95”;
$hot = “yes”;
echo statements will print:
if (($degrees > 100) || ($hot == “yes”)) {
echo “<P>TEST 1: It’s <strong>really</strong> hot!</P>”;
} else {
echo “<P>TEST 1: It’s bearable.</P>”;
}
if (($degrees > 100) && ($hot == “yes”)) {
echo “<P>TEST 2: It’s <strong>really</strong> hot!</P>”;
} else {
echo “<P> TEST 2: It’s bearable.</P>”;
}
?>
</BODY>
</HTML>