PHP – if else Statements

If Else Statements allow for code to run if a condition is true, but have different code run of a condition is false.

 

<?php
$age = 15;
print “Your Age is $age”;
print “<br>”;
if ($age < 18) {
print “you too YOUNG”;
}else {
print “You’re Old Enough”;
}
?>

Be the first to comment

Leave a Reply