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

Class: Validate_IS

Source Location: /Validate_IS-0.1.0/Validate/IS.php

Class Overview


Data validation class for IS


Author(s):

Copyright:

  • 2005 The PHP Group

Methods


Inherited Variables

Inherited Methods


Class Details

[line 37]
Data validation class for IS

This class provides methods to validate:

  • SSN (Social Security Number (Icelanidc: kennitala))
  • Postal code
  • Telephone number



[ Top ]


Method Detail

postalCode   [line 127]

bool postalCode( int $postcode, [bool $strong = true])

validates a postcode

Validates Icelandic postalcodes. By defaults checks against (prefetched) csv list containing all Icelanidc postalcodes. If the list is one month old, trys to update it.

  • Access: public

Parameters:

int   $postcode   —  the postcode to be validated
bool   $strong   —  optional; strong checks (default)

[ Top ]

ssn   [line 54]

bool ssn( string $ssn)

Validation according to http://www.hagstofa.is/?PageID=1474

Note: Icelandic SSN (Social Security Number) is on the form ddmmyy-xxxx. Here we strip the "-" char from the string (if present) and/or spaces in our match. Note: PASS IN STRING, NO EXCEPTIONS! SSN with leading zero (passed as integer) will NOT get vallidated!

  • Access: public

Parameters:

string   $ssn   —  SSN

[ Top ]

tel   [line 177]

bool tel( string $tel)

Checks that the telephone number is 7digits and legal home/office/gsm number (not information/emergency service etc.)

NOTE: Number prefixed with 00354 or +354 are allowed

Note: Icelandic telephone numbers are on the form xxx-xxxx. Here we strip the "-" char from the string (if present) and/or spaces in our match.

  • See:
  • Access: public

Parameters:

string   $tel   —  the telephone number

[ Top ]


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