You are here

function valid_br_phone_number in Phone 7

Same name and namespace in other branches
  1. 6 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

include/phone.br.inc, line 22
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);
}