JavaScript Editor Javascript validator     Web page editor 


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


require_once '/Validate/AU.php';

bool Validate_AU::phoneNumber (string $number [, int $flags = VALIDATE_AU_PHONENUMBER_NATIONAL])


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 Check that $flags contains a valid flag.


throws no exceptions thrown


author Alex Hayes <>

author Daniel O'Connor <>


This function can not be called statically.

JavaScript Editor Javascript validator     Web page editor