RE: [PHP-WIN] checking phone number

From: Date: Wed, 20 Dec 2000 21:14:15 +0000
Subject: RE: [PHP-WIN] checking phone number
Groups: php.windows 
Request: Send a blank email to php-windows+get-4566@lists.php.net to get a copy of this message
oh, yeah... that's a hell of an idea... why didn't I think of it, much better. It negates all characters except the numbers... great for making the input idiot proof. I'm sure they'll build a better idiot though! --------------------- John Asendorf - jasendorf@lcounty.com Web Applications Developer http://www.lcounty.com - NEW FEATURES ADDED DAILY! Licking County, Ohio, USA 740-349-3631 The benefit to the government of replacing all $1 Federal Reserve notes with $1 coins would be $522.2 million per year, according to estimates of the General Accouting Office released on April 7, 2000. > -----Original Message----- > From: Cynic [mailto:cynic@mail.cz] > Sent: Wednesday, December 20, 2000 3:56 PM > To: afan; php-windows@lists.php.net > Subject: Re: [PHP-WIN] checking phone number > > > $checkphone = preg_replace( '/[^0123456789]/' , '' , $phone ) > > simpler, better, shorter, faster > > > At 00:40 21.12. 2000, afan wrote the following: > -------------------------------------------------------------- > >Hi all, > >First I want to wish to everybody Happy holydays! > > > >I have to check does submitted phone number already exist in > database. I just wrote this: > >$CheckPhone = ereg_replace("\.", "", $Phone); > >$CheckPhone = ereg_replace(" ", "", $CheckPhone); > >$CheckPhone = ereg_replace("\(", "", $CheckPhone); > >$CheckPhone = ereg_replace("\)", "", $CheckPhone); > >$CheckPhone = ereg_replace("\-", "", $CheckPhone); > >$CheckPhone = ereg_replace("\/", "", $CheckPhone); > > > >and it works fine! > >But, probably there is something simpler, better and > shorter. Anybody have an idea? > > > >Afan > ------end of quote------ > > > > ____________________________________________________________ > Cynic: > > A member of a group of ancient Greek philosophers who taught > that virtue constitutes happiness and that self control is > the essential part of virtue. > > cynic@mail.cz > > > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net > For additional commands, e-mail: php-windows-help@lists.php.net > To contact the list administrators, e-mail: > php-list-admin@lists.php.net >

« previous php.windows (#4566) next »