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

Class: Validate_UK

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

Class Overview


Data validation class for the UK


Author(s):

Version:

  • Release: @package_version@

Copyright:

  • 2005 The PHP Group

Methods


Inherited Variables

Inherited Methods


Class Details

[line 45]
Data validation class for the UK

This class provides methods to validate:

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



[ Top ]


Method Detail

bankAC   [line 134]

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

bool carReg( string $reg)

Validates a car registration number

Parameters:

string   $reg   —  the registration number

[ Top ]

drive   [line 220]

bool drive( string $dl)

Validates a UK driving licence

Parameters:

string   $dl   — 

[ Top ]

passport   [line 203]

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

Validates a UK passport number, EU might be the same just checks for 9 digits mine starts 00 and i have included that - might cause problems

Parameters:

string   $   — 
string   $name   — 
   $pp   — 

[ Top ]

postalCode   [line 64]

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

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

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 ]

tel   [line 152]

bool tel( string $tel)

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

Parameters:

string   $tel   —  the tel number

[ Top ]


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