You are here

function sms_valid_is_local_number in SMS Framework 6.2

Same name and namespace in other branches
  1. 6 modules/sms_valid/sms_valid.module \sms_valid_is_local_number()
  2. 7 modules/sms_valid/sms_valid.module \sms_valid_is_local_number()

Check if number is a local number

Parameters

$number: A phone number

Return value

Boolean. Whether this is a local number.

1 call to sms_valid_is_local_number()
sms_valid_validate in modules/sms_valid/sms_valid.module
Validate a number

File

modules/sms_valid/sms_valid.module, line 432
Number validation feature module for Drupal SMS Framework.

Code

function sms_valid_is_local_number($number) {
  $prefix = variable_get('sms_valid_local_number_prefix', '0');

  // A blank prefix string makes this return false
  if ($prefix !== '' && preg_match("/^{$prefix}/", $number)) {
    return TRUE;
  }
  else {
    return FALSE;
  }
}