function valid_el_phone_number in Phone 7
Same name and namespace in other branches
- 6 phone.el.inc \valid_el_phone_number()
Verifies that $phonenumber is valid
Parameters
string $phonenumber:
Return value
boolean Returns boolean FALSE if the phone number is not valid.
File
- include/
phone.el.inc, line 21 - CCK Field for Greek phone numbers.
Code
function valid_el_phone_number($phonenumber) {
// define regular expression
$regex = "/^(\\+30)?[ ]?([0-9]{3,4}(\\/|-| )?[0-9]{6,7})\$/i";
// return true if valid, false otherwise
return (bool) preg_match($regex, $phonenumber);
}