function valid_br_phone_number in Phone 6
Same name and namespace in other branches
- 7 include/phone.br.inc \valid_br_phone_number()
Verification for Brazilian Phone Numbers.
Parameters
string $phonenumber:
Return value
boolean Returns boolean FALSE if the phone number is not valid.
File
- ./
phone.br.inc, line 23 - CCK Field for Brazilian phone numbers. (based on CCK Field for French phone numbers.)
Code
function valid_br_phone_number($phonenumber) {
$phonenumber = trim($phonenumber);
/*
$phonenumber = str_replace(array(' ','-','(',')'), '', $phonenumber);
*/
return (bool) preg_match(PHONE_BR_REGEX, $phonenumber);
}