Mobile phone number validation
Posted: Mon Aug 09, 2010 7:10 pm
Hi,
I am new to PHP and am trying to validate a mobile phone number in an form I am working on. I have used a validation class that I found but am having trouble adding my own.
How do I say "is not equals to '07' followed by any other numbers"
I have this:
Thanks
Phil
I am new to PHP and am trying to validate a mobile phone number in an form I am working on. I have used a validation class that I found but am having trouble adding my own.
How do I say "is not equals to '07' followed by any other numbers"
I have this:
Code: Select all
function DoValidate(&$formars,&$error_hash)
{
if($formars['Mphone']!="07"+"^[0-9]")
{
$error_hash['Mphone']="Please enter a valid mobile number";
return false;
}
return true;
}Phil