Validate_AU::phoneNumber
Вернуться к: Validate_AU
Validate_AU::phoneNumber
Synopsis
bool Validate_AU::phoneNumber ( string $number , int $flags = VALIDATE_AU_PHONENUMBER_NATIONAL )
Note that this function supports the following notations:
Landline: 03 9999 9999
Mobile: 0400 000 000 (as above, but usually notated differently)
Indial: 131 812 / 1300 000 000 / 1800 000 000 / 1900 000 000
International: +61.3 9999 9999
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.
Parameter
- 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 Check that $flags contains a valid flag.
Throws
throws no exceptions thrown
Note
This function can not be called statically.
Вернуться к: Validate_AU