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

Class: Validate_ZA

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

Class Overview


Data validation class for South Africa


Author(s):

Version:

  • Release: @package_version@

Copyright:

  • 1997-2005 Jacques Marneweck

Methods


Inherited Variables

Inherited Methods


Class Details

[line 46]
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 63]

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 90]

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 118]

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 Mon, 11 Mar 2019 15:30:24 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.