You are here

function ca_validate_number in Phone Number 6

Same name and namespace in other branches
  1. 7 includes/phone.ca.inc \ca_validate_number()

Verifies that $number is a valid ten-digit North American phone number.

Parameters

$number: Digits only value.

$ext: Digits only value.

$error: The error message to shown to user. Available parameters to use in the error message are

  • "%countrycode": the alpha-2 CC
  • "%phone_input": the original number input by user (could be invalid)
  • "%max_length": allowed maximum length of the phone number

Return value

boolean TRUE if it is a valid phone number for that country, FALSE otherwise.

File

includes/phone.ca.inc, line 24
CCK Field for Canada phone numbers.

Code

function ca_validate_number($number, $ext = '', &$error) {
  return us_validate_number($number, $ext = '', $error);
}