note 79635 deleted from function.is-float by felipe

From: Date: Sun, 16 Dec 2007 01:16:09 +0000
Subject: note 79635 deleted from function.is-float by felipe
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-133610@lists.php.net to get a copy of this message
Note Submitter: nicholas at blasgen dot com Reason: 1 ---- Sorry, I'm going to adjust my code one more time. Much quicker. All we do is look for a single decimal place and then numbers on both sides. I guess this only works for type STRING, not all mixed vars. So mine has it's flaws as well. But I tend to pull from files and files are all strings. function better_float_check($float) { $split = split('\.', $float); if ( count($split) == 2 ) { if ( ctype_digit($split[0]) && ctype_digit($split[1]) ) return true; else return false; } else { return false; } }

« previous php.notes (#133610) next »