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

Class: Validate_NZ

Source Location: /Validate_NZ-0.1.2/Validate/NZ.php

Class Overview


Data validation class for New Zealand


Author(s):

Copyright:

  • (c) 2006 Byron Adams

Methods


Inherited Variables

Inherited Methods


Class Details

[line 34]
Data validation class for New Zealand

This class provides methods to validate:

  • IRD numbers
  • Regional codes
  • Telephone number
  • Postal code
  • Bank AC



[ Top ]


Method Detail

bankCode   [line 194]

bool bankCode( $bankcode, string $bankcode,)

Validates a New Zealand Bank Account Number

This function checks wheather the given value is a valid New Zealand bank account number. allows several formats.

  • Return: The valid or invalid Bank Account Number
  • Access: public

Parameters:

string   $bankcode,   —  number to validate
   $bankcode   — 

[ Top ]

carReg   [line 218]

bool carReg( $reg, string $reg,)

Validates a New Zealand Vehicle license plates

This function checks wheather the given value is a valid New Zealand Vehicle license plate

6 characters for cars or trucks and 5 characters for motorbikes and trailors

  • Return: The valid or invalid license plate number
  • Access: public

Parameters:

string   $reg,   —  string to validate
   $reg   — 

[ Top ]

phoneNumber   [line 135]

bool phoneNumber( $number, [ $requireAreaCode = true], string $number,, bool $requireAreaCode,)

Validates a New Zealand phone number

This function validates all New Zealand phone numbers checks for landline,0800,0900,0508,021,027 and 025 numbers allows for various combinations with spaces dashes and parentheses.

  • Return: The valid or invalid phone number
  • Access: public

Parameters:

string   $number,   —  the number to validate
bool   $requireAreaCode,   —  require the area code? (default: true)
   $number   — 
   $requireAreaCode   — 

[ Top ]

postalCode   [line 45]

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

Validate New Zealand postal codes

Parameters:

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

[ Top ]

region   [line 117]

bool region( $region, string $region,)

Validates a New Zealand Regional Code

Parameters:

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

[ Top ]

ssn   [line 86]

bool ssn( $ssn, string $ssn,)

Validates a New Zealand IRD Number (ssn equiv)

recently the format has changed to having a prefix of 0, this will work with both new and old IRD numbers.

  • Return: The valid or invalid ird number
  • Access: public

Parameters:

string   $ssn,   —  IRD number to validate
   $ssn   — 

[ Top ]


Documentation generated on Thu, 10 Dec 2015 05:40:32 +0000 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.