Validate_AU::phoneNumber()

Validate_AU::phoneNumber() -- Validate a telephone number.

Synopsis

Описание

Note that this function supports the following notations:

For International numbers, only +61 will be valid, as this is Australia's dial code, and the format MUST be +61.3, where 3 represents the state dial code, in this case, Victoria.

Note: If the VALIDATE_AU_PHONENUMBER_STRICT flag is not supplied, then all spaces, dashes and parenthesis are removed before validation. You will have to strip these yourself if your data storage does not allow these characters.

Параметр

string $number

The telephone number

integer $flags

Can be a combination of the following flags:

  • VALIDATE_AU_PHONENUMBER_STRICT: if supplied then no spaces, parenthesis or dashes (-) will be removed.

  • VALIDATE_AU_PHONENUMBER_NATIONAL: when supplied valid national numbers (eg. 03 9999 9999) will return TRUE.

  • VALIDATE_AU_PHONENUMBER_INDIAL: when supplied valid indial numbers (eg. 13/1300/1800/1900) will return TRUE.

  • VALIDATE_AU_PHONENUMBER_INTERNATIONAL: when supplied valid international notation of Australian numbers (eg. +61.3 9999 9999) will return TRUE.

ToDo

todo Check that $flags contains a valid flag.

Throws

throws no exceptions thrown

author

author Alex Hayes <ahayes@wcg.net.au>

author Daniel O'Connor <daniel.oconnor@gmail.com>

Заметка

Эта функция не должна вызываться статически.

    Поддержать сайт на родительском проекте КГБ