Re: Phone Number #s Only?
| From: | mike cullerton | Date: | Fri, 03 Aug 2001 03:28:49 +0000 |
| Subject: | Re: Phone Number #s Only? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-61035@lists.php.net to get a copy of this message | ||
actually, it removes everything from $string that is not in the range 0-9.
when a ^ is the first character inside [], it negates whatever is inside.
ereg_replace ("^[0-9]","",$string); would remove the first character from
$string if it were in the range 0-9.
on 8/2/01 6:39 PM, Martin Cameron at cameron@cameron.co.nz wrote:
> Just as the solution to spray paint the m/b green made me smile, this did
> too.
>
> This will strip out all characters except numerals at the beginning, right!
>
> martin Cameron
>
> On Fri, 03 Aug 2001 11:52, you wrote:
>> on 8/2/01 5:32 PM, Jeff Oien at jeff@webdesigns1.com wrote:
>>> Is there a routine out there to strip all characters from a phone
>>> number except the numbers? I was going to write my own but
>>> figured there must already be one out there I can use. Thanks.
>>> Jeff Oien
>>
>> ereg_replace ("[^0-9]","",$string);
>>
>> -- mike cullerton
-- mike cullerton