Try
ereg("^[0-9]{10}$", $cust_tel);
Quick explanation (I get the feeling you're new at regexes):
^ - beginning of string
[0-9] - any number between 0 and 9 inclusive
{10} - exactly ten times
$ - end of string
There ya go.
J
B. Verbeek wrote:
> Hello,
>
> I want to check the data from a form-field if it excists only of digits
> (0-9) and nothing else.
>
> How do I use the ereg()-function for this?
>
> >> ereg("[0-9]",$cust_tel, $cust_tel); <<
>
> It is also to turn it around but then the pattern will get larger because
> it has to contain:
> / "'.,-)(*&^%# a-z A-Z and so on...
>
> The field has to be 10 digits long and has to contain only digits!!!
>
>
> Can anyone help me?
>
> Regards,
>
> Bart
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]