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

Class: Validate_ZA

Source Location: /Validate_ZA-0.2.0/Validate/ZA.php

Class Overview


Data validation class for South Africa


Author(s):

Version:

  • Release: @package_version@

Copyright:

  • 2005 The PHP Group

Methods


Inherited Variables

Inherited Methods


Class Details

[line 45]
Data validation class for South Africa

This class provides methods to validate:

  • Social insurance number (aka SSN)
  • Province code
  • Postal code



[ Top ]


Method Detail

postalCode   [line 60]

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

Validate a South African Postal Code

I've downloaded a list of postal codes from the SAPO website and reduced the list down to unique postal codes.


Parameters:

string   $postcode   —  the postal code to validate
bool   $strong   —  optional; strong checks (e.g. against a list of postcodes)

[ Top ]

region   [line 86]

bool region( string $region)

Validates a "region" (i.e. province) code
  • Return: true if valid else false
  • Access: public

Parameters:

string   $region   —  2-letter province code

[ Top ]

ssn   [line 113]

bool ssn( string $id)

Validate a South African ID Number
  • Return: true if valid else false
  • Access: public

Parameters:

string   $id   —  11 digit South African Identity Number

[ Top ]


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