Re: cvs: pear /Validate Validate.php

From: Date: Wed, 29 May 2002 09:05:15 +0000
Subject: Re: cvs: pear /Validate Validate.php
References: 1  Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-4236@lists.php.net to get a copy of this message
le 29/05/02 10:29, Tomas V.V.Cox à cox@idecnet.com a écrit : >> Wouldn't it be better if you split the number method into integer and float >> with both minus numbers accepted ? >> > > Do you think is really necessary? > > - integer validation: Validate::number($number) > - float validation: Validate::number($number, '.', 2) > // (number, decimal char, precition) > > If you want to add range validation (let's say between 8 and 12) just: > > - integer validation: Validate::number($number, null, null, 8, 12) > - float validation: Validate::number($number, '.', 2, 8, 12) Remember an integer or a float can also be negative. If you add this as a parameter, it can become difficult to remember the parameters order. Thanks for the preg changes (I much prefer them :-). Bertrand Mansion Mamasam

« previous php.pear.cvs (#4236) next »