PHP – Logical Operators

Logical Operators allow you to use AND or OR in comparisons for Loops and If Statements.

<?php

$species  = "canine";
$age = 1;

if ($species == 'canine' && $age <= 2) {
	print "It's a PUPPY";
	print "<br>";
}

if ($species == 'canine' || $species == 'cat') {
	print "Your pet is sooo cute";
}
?>

Be the first to comment

Leave a Reply