Added mobile number validation functionality

This commit is contained in:
2015-09-11 18:23:20 +10:00
parent 948e90ad7c
commit e6fa6f0ee5
2 changed files with 19 additions and 2 deletions

View File

@@ -101,6 +101,18 @@ function _valid_phone_number($input)
*/
}
function _valid_australian_mobile_number($input)
{
if (preg_match('/^\s*(?:\+61|61|0061|0)(\d{3})\s*(\d{3})\s*(\d{3})\s*$/', $input, $matches))
{
watchdog('booking', 'Australian Mobile Number "!passnum" validates since it passed our regexp',
array('!passnum' => $input));
return TRUE;
}
else
return FALSE;
}
/**
* Helper function to check whether the number of registrations for the current event have reached their defined maximum size