function valid_fr_phone_number in Phone 6
Same name and namespace in other branches
- 5 phone.fr.inc \valid_fr_phone_number()
- 5 phone.uk.inc \valid_fr_phone_number()
- 7 include/phone.fr.inc \valid_fr_phone_number()
Verification for French Phone Numbers. According to http://www.itu.int/itudoc/itu-t/number/f/fra/70680.html (Released 2006/01/26, retrieved 2008/08/12)
Parameters
string $phonenumber:
Return value
boolean Returns boolean FALSE if the phone number is not valid.
File
- ./
phone.fr.inc, line 26 - CCK Field for French phone numbers.
Code
function valid_fr_phone_number($phonenumber) {
//$phonenumber = trim($phonenumber);
$phonenumber = str_replace(array(
' ',
'-',
'(',
')',
), '', $phonenumber);
return (bool) preg_match(PHONE_FR_REGEX, $phonenumber);
}