note 30780 deleted from function.ereg by irchtml

From: Date: Wed, 25 Feb 2004 17:34:36 +0000
Subject: note 30780 deleted from function.ereg by irchtml
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-65747@lists.php.net to get a copy of this message
Note Submitter: :: h0nk - ace@ogbrozzas.de :: ---- check da $price input wid da following regex. if (ereg ('^0|[1-9][0-9]*|[1-9][0-9]*[.][0-9]{1,2}$', $price)) {$price ;} else {print "!!! ERROR !!!" ;} this regex allows u 2 set a standalone "0" OR an integer value OR an decimal value. u can format da output with - printf ("%0.2f", $price) - to get da right format for $money$ like this - 0.00 - visit me @ www.ogbrozzas.de and IRC #OGz @ Quakenet

« previous php.notes (#65747) next »