note 42959 added to function.is-numeric

From: Date: Fri, 04 Jun 2004 18:50:50 +0000
Subject: note 42959 added to function.is-numeric
Groups: php.notes 
Request: Send a blank email to php-notes+get-70798@lists.php.net to get a copy of this message
Wrote 2 suitable functions for checking Web-forms: <?php function isInt($var) { return ereg('^[\+-]{0,1}[0-9]+(\.[0]+){0,1}$', trim(strval($var))); } function isFloat($var) { return ereg('^[\+-]{0,1}[0-9]+(\.[0-9]+){0,1}$', trim(strval($var))); } ?> They don't work with eE-notation. ---- Manual Page -- http://www.php.net/manual/en/function.is-numeric.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+42959 Delete -- http://master.php.net/manage/user-notes.php?action=delete+42959&report=yes Reject -- http://master.php.net/manage/user-notes.php?action=reject+42959&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#70798) next »