PHP if else

ELSE allows you to choose between two results:

if ($firstvalue==$secondvalue) {
    echo "<p>the values are the same</p>";
} else {
    echo "<p>the values are different</p>";
    echo "<p>sorry about that</p>";
}
        

Note that the curly brackets (braces) can hold any number of lines of code.

submit to reddit Delicious Tweet