You are here

function valid_el_phone_number in Phone 6

Same name and namespace in other branches
  1. 7 include/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

./phone.el.inc, line 22
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);
}