You are here

function valid_fr_phone_number in Phone 5

Same name in this branch
  1. 5 phone.fr.inc \valid_fr_phone_number()
  2. 5 phone.uk.inc \valid_fr_phone_number()
Same name and namespace in other branches
  1. 6 phone.fr.inc \valid_fr_phone_number()
  2. 7 include/phone.fr.inc \valid_fr_phone_number()

Verifies that $phonenumber is a valid eleven-digit United Kingdom phone number

Regular expression adapted from Amos Hurd's regex at RegExLib.com

Parameters

string $phonenumber:

Return value

boolean Returns boolean FALSE if the phone number is not valid.

File

./phone.uk.inc, line 12

Code

function valid_fr_phone_number($phonenumber) {

  //$phonenumber = trim($phonenumber);
  if (!preg_match("/^(\\+){0,1}([0-9 ])*[0-9]\$/i", $phonenumber)) {
    return false;
  }
  else {
    return true;
  }
}