function sms_valid_is_local_number in SMS Framework 7
Same name and namespace in other branches
- 6.2 modules/sms_valid/sms_valid.module \sms_valid_is_local_number()
- 6 modules/sms_valid/sms_valid.module \sms_valid_is_local_number()
Checks if a number is a local number.
Parameters
string $number: A phone number.
Return value
bool true if this is a local number, false otherwise.
2 calls to sms_valid_is_local_number()
- SmsValidWebTest::testSmsValidFunctions in modules/
sms_valid/ sms_valid.test - Tests the internal sms_valid functions.
- sms_valid_validate in modules/
sms_valid/ sms_valid.module - Validates a number.
File
- modules/
sms_valid/ sms_valid.module, line 442 - 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;
}
}