IFs in PHP work similar to mIRC, almost identically, in fact.

PHP uses { } brackets for multi-line "THEN" statements. Any additional IFs that are within the { } of a previous IF/ELSEIF/ELSE are nested. Any IFs that are outside the { } of previous IF/ELSEIS/ELSE are not considered part of those previous structures. Each new IF statement that is not nested, resets the IF structure (as opposed to being reset by the ELSEIF and ELSE, because those two statements are optional).

-genius_at_work