PHP if elseif

You can also ask another question depending on the result of the first one. If the first IF is true then the second question never gets asked:

if ($firstvalue==$secondvalue) {
    echo "<p>the values are the same</p>";
} elseif ($firstvalue<$secondvalue) {
    echo "<p>the first value is smaller</p>";
} else {
    echo "<p>the second value is smaller</p>";
}
        

Change the variable values a few times and upload the page each time. Follow the code through until you understand how this sort of conditional statement works.

submit to reddit Delicious Tweet