note 35338 deleted from function.floor by victor

From: Date: Thu, 28 Aug 2003 10:47:33 +0000
Subject: note 35338 deleted from function.floor by victor
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-55209@lists.php.net to get a copy of this message
Note Submitter: timmusagersea@hotmail.com ---- The following function uses fmod() rather than floor() to determine odd vs even. Please email me and accept my apology for the garbage note if there is an intrinsic PHP function to accomplish this... Function IsEven($integer) { // Expects integer (whole number) $result = fmod($integer,2); If($result == 1) { Return(FALSE); } ElseIf($result == 0) { Return(TRUE); } Else { // Error } }

« previous php.notes (#55209) next »