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

Class: Validate_FI

Source Location: /Validate_FI-0.1.0/Validate/FI.php

Class Overview


Data validation class for Finland


Author(s):

Methods


Inherited Variables

Inherited Methods


Class Details

[line 54]
Data validation class for Finland

This class provides methods to validate:

  • Postal code
  • Telephone number
  • Car registration number
  • Motorbike registration number
  • Personal Identity number (HETU)
  • Unique Identification number (SATU)
  • Business ID (Y-tunnus)
  • Finnish Party Identification number (OVT-tunnus)
  • Value Added Tax number (ALV-numero)
  • Finnish bank account number (tilinumero)
  • Finnish bank reference number (viitenumero)
  • Credit Card number



[ Top ]


Method Detail

bankAccount   [line 351]

bool bankAccount( string $number)

Validate Finnish bank account number

This method checks the bank account number according to Finnish Bank Association.

Format: XXXXXX-XXXXXXXX, 6 digits, - and 2-8 digits.

More information in Finnish:


Parameters:

string   $number   —  Finnish bank account number to be validated

[ Top ]

bikeReg   [line 128]

bool bikeReg( string $reg)

Validate Finnish motorbike registration number

Format: AAAXXX

Where AAA is 2-3 letters UPPERCASE A-Z and XXX is 1-3 numbers. Letters and numbers are actually in separate lines.

  • Return: true if registration number is valid, false otherwise
  • Access: public

Parameters:

string   $reg   —  the registration number to be validated

[ Top ]

businessId   [line 236]

bool businessId( string $businessid)

Validate Finnish Business ID (Y-tunnus)

The Finnish Business ID (Y-tunnus) number is a 9 digit number. The last digit is a control number (y). Example: xxxxxxx-y

More information in Finnish:


Parameters:

string   $businessid   —  Business ID number to be validated

[ Top ]

carReg   [line 108]

bool carReg( string $reg)

Validate Finnish car registration number

Format: AAA-XXX

Where AAA is 2-3 letters UPPERCASE A-Z and XXX is 1-3 numbers.

  • Return: true if registration number is valid, false otherwise
  • Access: public

Parameters:

string   $reg   —  the registration number to be validated

[ Top ]

creditCard   [line 449]

bool creditCard( string $number)

Validate credit card number

This method checks the credit number according to Luhn algorithm. This method doesn't guarantee that the card is legitimate.

  • Return: true if credit card number is valid, false otherwise
  • See: mod10()
  • Access: public

Parameters:

string   $number   —  credit card number to be validated (spaces and dashes tolerated)

[ Top ]

finuid   [line 204]

bool finuid( string $finuid)

Validate Finnish Unique Identification Number (SATU)

The Finnish FINUID (SATU) number is a 9 digit number. The last digit is a control number (y). Example: 10011187H

More information in Finnish:


Parameters:

string   $finuid   —  FINUID number to be validated

[ Top ]

partyId   [line 284]

bool partyId( int $partyid)

Validate Finnish Party Identification (OVT-tunnus)

The Finnish Party Identification (OVT-tunnus) number is a 12-17 digit number and it is generated from Business ID.

Example: 0037AAAAAAAABBBBB, 0037 indicates Finland, AAAAAAAA is the Business ID and BBBBB is optional organization number.

More information in Finnish:


Parameters:

int   $partyid   —  Party Identification number to be validated

[ Top ]

phoneNumber   [line 88]

bool phoneNumber( string $number)

Validate Finnish telephone number

Simple check: number must be numeric when (, ), -, +, ., ' ' chars removed

  • Return: true if telephone number is valid, false otherwise
  • Access: public

Parameters:

string   $number   —  the telephone number to be validated

[ Top ]

pin   [line 160]

mixed pin( string $pin, [bool $gender = false])

Validate Personal Identity Number (HETU)

The Finnish PIN (HETU) number is a 11 digit number with birthdate as ddmmyycxxxy where c is century, xxx is a three digit individual number and the last digit is a control number (y).

If xxx is odd it's a male PIN number and if even a female.

Return gender (M or F) if valid PIN, is available by switching $gender (2nd parameter) to true.

Example: 010101-123N would be a male and born in 1st of January 1901.

More information in Finnish:


Parameters:

string   $pin   —  PIN number to be validated
bool   $gender   —  optional; Returns gender (M or F) if valid PIN

[ Top ]

postalCode   [line 69]

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

Validate Finnish postal code

Five digit postal code, maybe with a leading 'FI-'

  • Return: true if postal code is valid, false otherwise
  • Access: public

Parameters:

string   $code   —  the postal code to be validated
bool   $strong   —  optional; strong checks (e.g. against a list of postal codes)

[ Top ]

refNum   [line 396]

bool refNum( string $refnum)

Validate Finnish bank reference number

This method checks the bank reference number according to Finnish Bank Association.

More information in Finnish:


Parameters:

string   $refnum   —  Finnish bank reference number to be validated

[ Top ]

vatNumber   [line 319]

bool vatNumber( string $vatnumber)

Validate Finnish Value Added Tax number (ALV-numero)

The Finnish VAT number (ALV-numero) is maximum of 14 digits and is generated from Business ID.

More information in Finnish:


Parameters:

string   $vatnumber   —  VAT number to be validated

[ Top ]


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