Re: Validation class method

From: Date: Thu, 06 Jun 2002 16:33:44 +0000
Subject: Re: Validation class method
References: 1  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-6748@lists.php.net to get a copy of this message
On Thu, 6 Jun 2002, Pierre-Alain Joye wrote: > On Thu, 6 Jun 2002 11:05:24 -0500 (CDT) > Brent Cook <busterb@mail.utexas.edu> wrote: > > > That's a good idea. What do you think about this simpler version? > > > > function ssn($inbound) > > { > > // remove any dashes, spaces, returns, tabs or slashes > > $inbound = str_replace(array('-','/',' > > ',"\t","\n"),'',$inbound); > > > > // check if this is a 9-digit number > > return (is_int($inbound) && (strlen($inbound) == 9)); > > } > > > > - Brent > is "123456789" a valid ssn ? :) > > just curious, > > pa Probably not. I'm looking here for more info. Perhaps this could be a little less trivial. http://www.privateinvestigatorsoftware.com/articles/social_security.htm - Brent

« previous php.pear.dev (#6748) next »