function valid_fr_phone_number in Phone 5
Same name in this branch
- 5 phone.fr.inc \valid_fr_phone_number()
- 5 phone.uk.inc \valid_fr_phone_number()
Same name and namespace in other branches
- 6 phone.fr.inc \valid_fr_phone_number()
- 7 include/phone.fr.inc \valid_fr_phone_number()
Verifies that $phonenumber is a valid eleven-digit United Kingdom phone number
Regular expression adapted from Amos Hurd's regex at RegExLib.com
Parameters
string $phonenumber:
Return value
boolean Returns boolean FALSE if the phone number is not valid.
File
- ./
phone.uk.inc, line 12
Code
function valid_fr_phone_number($phonenumber) {
//$phonenumber = trim($phonenumber);
if (!preg_match("/^(\\+){0,1}([0-9 ])*[0-9]\$/i", $phonenumber)) {
return false;
}
else {
return true;
}
}