RE: [PHP-WIN] checking phone number
| From: | Asendorf, John | Date: | Wed, 20 Dec 2000 21:04:15 +0000 |
| Subject: | RE: [PHP-WIN] checking phone number | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-4563@lists.php.net to get a copy of this message | ||
Give this line a quick try
$CheckPhone = ereg_replace("[-\.\(\)\/ ]", "", $phone);
---------------------
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.
> $CheckPhone = ereg_replace(" ", "", $CheckPhone);
> $CheckPhone = ereg_replace("\(", "", $CheckPhone);
> $CheckPhone = ereg_replace("\)", "", $CheckPhone);
> $CheckPhone = ereg_replace("\-", "", $CheckPhone);
> $CheckPhone = ereg_replace("\/", "", $CheckPhone);
---------------------
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: afan [mailto:afan@sprout.net]
> Sent: Wednesday, December 20, 2000 6:40 PM
> To: php-windows@lists.php.net
> Subject: [PHP-WIN] checking phone number
>
>
> 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
>