Skip to content
elcapo edited this page Oct 15, 2014 · 8 revisions

This function validates a Spanish identification number verifying its check digits. It doesn't need to be told about the document type, that can be a NIF, a NIE or a CIF.

  • NIFs and NIEs are personal numbers.
  • CIFs are corporates.

Dependencies

In order to determine what type or document is being validated, this function uses isValidNIFFormat, isValidNIEFormat and isValidCIFFormat. Then, it calls the appropriate isValidNIF, isValidNIE or isValidCIF function.

Return values

This function returns:

  • 1 - If specified identification number is correct.
  • 0 - Otherwise.

Usage

/* MySQL */
SELECT isValidIdNumber( 'G28667152' );
//JavaScript
var isValid = isValidIdNumber( 'G28667152' );
/* PHP */
$isValid = isValidIdNumber( 'G28667152' );

SEPA validations

  • [International Bank Account Numbers (IBAN)](International Bank Account Numbers (IBAN))

Spanish validations

Helpers

  • [Common functions](Common functions)
Clone this wiki locally