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

Class: Validate_UK

Source Location: /Validate_UK-0.5.4/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 50]
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 143]

bool bankAC( string $ac)

Validates a bank ac number

do not use - it is too basic at the moment

  • Access: public

Parameters:

string   $ac   —  the account number

[ Top ]

carReg   [line 186]

bool carReg( string $reg)

Validates a car registration number
  • Access: public

Parameters:

string   $reg   —  the registration number

[ Top ]

drive   [line 234]

bool drive( string $dl)

Validates a UK driving licence
  • Access: public

Parameters:

string   $dl   —  the driving license

[ Top ]

passport   [line 220]

string passport( string $pp)

Validates a UK passport number.

EU might be the same just checks for 9 digits

  • Access: public

Parameters:

string   $pp   —  the passport number

[ Top ]

phoneNumber   [line 164]

bool phoneNumber( string $number)

Checks that the entry is a number starting with 0 of the right length
  • See:
  • Access: public

Parameters:

string   $number   —  the tel number

[ Top ]

postalCode   [line 71]

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
  • See:
  • Access: public

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