Robert Cummings wrote:
> 
> Jeroen Timmers wrote:
> >
> > i want to check if a given string has only numbers
> >
> > for exampl
> >
> > $test = "343124312" TRUE
> > $test1 = "q34daf23423" FALSE
> 
> I'm tempted to say "go read about ereg(), but since it's
> just as long to provide a response...
> 
> return ereg( '^[[:alpha:]]*$', $testString );

I should kick myself...

return ereg( '^[[:digit:]]*$', $testString );

Cheers,
Rob.
-- 
.-----------------.
| Robert Cummings |
:-----------------`----------------------------.
| Webdeployer - Chief PHP and Java Programmer  |
:----------------------------------------------:
| Mail  : mailto:[EMAIL PROTECTED] |
| Phone : (613) 731-4046 x.109                 |
:----------------------------------------------:
| Website : http://www.webmotion.com           |
| Fax     : (613) 260-9545                     |
`----------------------------------------------'

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to