How can I tell if a string only contains numbers.
Is there an easy way of doing this in PHP?
I can establish whether a string contains some numbers using ereg(), however that will match numbers with letters too.
Thanks
[:digit:]+ would match TRUE if the string contains anything other than numbers.
you might want to try one of these instead:
[[:digit:]]+$ or [0-9]+$
Rgds