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

Class: Validate_UK

Source Location: /Validate_UK-0.5.3/Validate/UK.php

Class Overview


Data validation class for the UK


Author(s):

Version:

  • Release: @package_version@

Copyright:

  • 1997-2005 Michael Dransfield, Ian P. Christian

Methods


Inherited Variables

Inherited Methods


Class Details

[line 54]
Data validation class for the UK

This class provides methods to validate:

  • SSN (National Insurance/NI Number)
  • Sort code
  • Bank account number
  • Postal code
  • Telephone number
  • Car registration number
  • Passport
  • Driving license



[ Top ]


Method Detail

bankAC   [line 142]

bool bankAC( string $ac)

Validates a bank ac number do not use - it is too basic at the moment

Parameters:

string   $ac   — 

[ Top ]

carReg   [line 181]

bool carReg( string $reg)

Validates a car registration number

Parameters:

string   $reg   —  the registration number

[ Top ]

drive   [line 231]

bool drive( string $dl)

Validates a UK driving licence

Parameters:

string   $dl   — 

[ Top ]

passport   [line 216]

string passport( $pp, string $, string $name)

Validates a UK passport number, EU might be the same just checks for 9 digits

Parameters:

string   $   — 
string   $name   — 
   $pp   — 

[ Top ]

phoneNumber   [line 162]

bool phoneNumber( string $number)

Checks that the entry is a number starting with 0 of the right length

Parameters:

string   $number   —  the tel number

[ Top ]

postalCode   [line 73]

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

validates a postcode

Validation according to the "UK Government Data Standards Catalogue" Using PostCode-format version 2.1, which can be obtained from: http://www.govtalk.gov.uk/gdsc/html/noframes/PostCode-2-1-Release.htm

Note: The official validation-pattern was altered to also support postcodes with none or even spaces at various places. We don't count spaces as being "essential" for the validation-process. It was also necessary to refactor the regex to make it usable for preg_match.

  • Access: public

Parameters:

string   $postcode   —  the postcode to be validated
bool   $strong   —  optional; strong checks (e.g. against a list of postcodes) (not implanted)

[ Top ]

sortCode   [line 123]

bool sortCode( string $sc)

Validates a sort code, must be passed with dashes in the right places

Parameters:

string   $sc   —  the sort code

[ Top ]

ssn   [line 102]

bool ssn( string $ssn)

Validates a social security number whic in UK is National Insurance Number or ni for short

Validation according to the "UK Government Data Standards Catalogue" Using NationalInsuranceNumber-format version 2.1, which can be obtained from: http://www.govtalk.gov.uk/gdsc/html/noframes/NationalInsuranceNumber-2-1-Release.htm

Note: The official validation-pattern was altered to also support numbers with none or even spaces at various places. We don't count spaces as being "essential" for the validation-process.

  • Access: public

Parameters:

string   $ssn   —  NI number

[ Top ]


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