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

isValidIdNumber 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.

Usage

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

Return values

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

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.

Category

This function is part of the NIF, NIE & CIF package.

SEPA validations

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

Spanish validations

Helpers

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