note 95358 rejected from function.exit by thiago

From: Date: Tue, 29 Dec 2009 13:20:08 +0000
Subject: note 95358 rejected from function.exit by thiago
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-164427@lists.php.net to get a copy of this message
Note Submitter: valetarton at live dot com ---- quick question i am not sure why this is working i just accidently was fooling around with some stuff, when a year i type in on a previous page and for some reason the exit breaks out of the inner IF statement and goes to the ELSE statement of the first IF block. can some one tell me why? It works correctly i am just curious why though. Is it because it is causing the first IF block to be already executed and exited out so it goes to the ELSE statement? <?php $year = $_POST['year']; if ($year % 4 && $year % 100) { if ($year % 400 == false) { exit; } echo 'not a leap year'; } else echo 'is a leap year'; ?>

« previous php.notes (#164427) next »