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

Class: Validate_NZ

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

Class Overview


Data validation class for New Zealand


Author(s):

Version:

  • Release: @package_version@

Methods


Inherited Variables

Inherited Methods


Class Details

[line 51]
Data validation class for New Zealand

This class provides methods to validate:

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



[ Top ]


Method Detail

bankCode   [line 290]

bool 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

[ Top ]

carReg   [line 309]

bool carReg( 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

[ Top ]

checkIRD   [line 326]

boolean checkIRD( string $ssn)

Return true if the checksum[s] in the specified value is valid as regards the value being a valid IRD number.
  • Access: public

Parameters:

string   $ssn   —  Value to perform the validation on

[ Top ]

phoneNumber   [line 151]

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

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.


Parameters:

string   $number   —  the number to validate
bool   $requireAreaCode   —  Optional (default: true)

[ Top ]

postalCode   [line 65]

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

Validate New Zealand postal codes
  • Return: The valid or invalid postal code
  • Link: www.nzpost.co.nz/nzpost/images/addressing.nzpost/pdfs/postcodedirectory_nomaps.pdf
  • Access: public

Parameters:

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

[ Top ]

region   [line 129]

bool region( string $region)

Validates a New Zealand Regional Code
  • Return: The valid or invalid regional code
  • Link: www.google.com/apis/adwords/developer/adwords_api_regions.html
  • Access: public

Parameters:

string   $region   —  regional code to validate

[ Top ]

ssn   [line 101]

bool 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
  • Link: www.ird.govt.nz/resources/file/eb70020dbbadb13/rwt-nrwt-spec-2006.pdf
  • Access: public

Parameters:

string   $ssn   —  IRD number to validate

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:43:03 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.