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

Class: Validate_FR

Source Location: /Validate_FR-0.6.0/Validate/FR.php

Class Overview


Data validation class for France


Author(s):

Version:

  • Release: @package_version@

Copyright:

  • 1997-2005 Pierre-Alain Joye, Bertrand Gugger

Methods


Inherited Variables

Inherited Methods


Class Details

[line 54]
Data validation class for France

This class provides methods to validate:

  • Social insurance number (aka SSN)
  • French RIB
  • French SIREN number
  • French SIRET number
  • Postal code
  • French "departement"



[ Top ]


Method Detail

nameDepartement   [line 272]

mixed nameDepartement( [string $departement = null])

Name of a French "departement"
  • Return: The department's name, special chars in numeric entities or '' No argument, returns the array of known code => departements

Parameters:

string   $departement   —  2 (2A or 2B included) or 3 -digit department number or none to get the list

[ Top ]

postalCode   [line 256]

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

Validates a French Postal Code format
  • Return: true if code is valid, false otherwise
  • Todo: Validate against department
  • Access: public

Parameters:

string   $postalCode   —  the code to validate
bool   $strong   —  optional; strong checks (e.g. against a list of postcodes) (not implanted)

[ Top ]

region   [line 399]

mixed region( string $region)

Validates a French "departement"
  • Return: The department's name, special chars numeric entities (true) or false

Parameters:

string   $region   —  2 (2A or 2B included) or 3 -digit department number

[ Top ]

rib   [line 131]

bool rib( array $rib)

Validate a french RIB see http://www.ecbs.org/Download/Tr201v3.9.pdf
  • Return: true if number is valid, otherwise false

Parameters:

array   $rib   —  number or an associative array: "aCodeBanque" => 1234 "aCodeGuichet" => 1234 "aNoCompte" => 1234

[ Top ]

siren   [line 181]

bool siren( string $siren)

Validate a french SIREN number see http://xml.insee.fr/schema/siret.html
  • Return: true if number is valid, otherwise false

Parameters:

string   $siren   —  number or an array containaing the 'number'=>1234

[ Top ]

siret   [line 213]

bool siret( string $siret)

Validate a french SIRET number see http://xml.insee.fr/schema/siret.html
  • Return: true if number is valid, otherwise false

Parameters:

string   $siret   —  number or an array containaing the 'number'=>1234

[ Top ]

ssn   [line 71]

bool ssn( string $ssn)

Validate a french SSN

TO DO : strong validation against the INSEE cities databases (rpc or local DB)

This function checks given number according the specs available here: http://www.dads.cnav.fr/tds/Stru0103.htm http://xml.insee.fr/schema/nir.html

  • Return: true if number is valid

Parameters:

string   $ssn   —  number or an array containing the 'number'=>1234

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:34:43 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.