Try is_int($_POST['mobile_number']) or ctype_digit($_POST['mobile_number'])

HTH

Cheers

Chris

Robert Cummings wrote:

On Fri, 2004-10-15 at 07:45, Gareth Williams wrote:

Do you even need a regex?

What about

if (strlen($_POST['mobile_number']) != 11 && substr($_POST['mobile_number'],0,3) != 447)
{
$error="Invalid Number";
}



This doesn't verify that the portion following 447 is also a number.

   eg. 4474567X901

Cheers,
Rob.


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



Reply via email to