Validate_AU
[ class tree: Validate_AU ] [ index: Validate_AU ] [ all elements ]

Class: Validate_AU

Source Location: /Validate_AU-0.1.0/Validate/AU.php

Class Overview


Data validation class for Australia


Author(s):

Version:

  • Release: @package_version@

Copyright:

  • (c) 2006 Alex Hayes

Methods


Inherited Variables

Inherited Methods


Class Details

[line 66]
Data validation class for Australia

Contains code from Validate_AT, Validate_UK and Validate_NZ

This class provides methods to validate:

  • Postal code
  • Phone number
  • Australian Business Number
  • Australian Company Number
  • Tax File Number
  • Australian Regional codes



[ Top ]


Method Detail

abn   [line 275]

bool abn( string $abn)

Australian Business Number (ABN).

Validates an ABN using a modulus calculation


Parameters:

string   $abn   —  ABN to validate

[ Top ]

acn   [line 194]

bool acn( $acn, string $acn;)

Validate an Australian Company Number (ACN)

The ACN is a nine digit number with the last digit being a check digit calculated using a modified modulus 10 calculation.


Parameters:

string   $acn;   —  ACN number to validate
   $acn   — 

[ Top ]

checkDigit   [line 304]

bool checkDigit( $digits, $modulus, $weights, $length, array $digits;, int $modulus;, array $weights;, array $length;)

Validate number against decimal checksum (check digit)

A check digit is a form of redundancy check used for error detection, the decimal equivalent of a binary checksum. It consists of a single digit computed from the other digits in the message.


Parameters:

array   $digits;   —  Digits to check
int   $modulus;   — 
array   $weights;   — 
array   $length;   — 
   $digits   — 
   $modulus   — 
   $weights   — 
   $length   — 

[ Top ]

phoneNumber   [line 148]

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

Validate a telephone number.

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
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.


Parameters:

string   $number   —  The telephone number
int   $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.

[ Top ]

postalCode   [line 78]

bool postalCode( string $postcode, [bool $strong = false])

Validate Austrialian postal codes.
  • Return: true if postcode is ok, false otherwise
  • Access: public

Parameters:

string   $postcode   —  postcode to validate
bool   $strong   —  optional; strong checks against a list of postcodes

[ Top ]

region   [line 103]

bool region( $region, string $region,)

Validates Australian Regional Codes

Parameters:

string   $region,   —  regional code to validate
   $region   — 

[ Top ]

ssn   [line 235]

bool ssn( $ssn, string $ssn;)

Social Security Number.

Australia does not have a social security number system, the closest equivalent is a Tax File Number


Parameters:

string   $ssn;   —  ssn number to validate
   $ssn   — 

[ Top ]

tfn   [line 252]

bool tfn( $tfn $tfn)

Tax File Number (TFN)

Australia does not have a social security number system, the closest equivalent is a Tax File Number.


Parameters:

$tfn   $tfn   —  Tax File Number

[ Top ]


Documentation generated on Mon, 11 Mar 2019 14:46:21 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.