This repository was archived by the owner on Mar 4, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
isValidIdNumber
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.
/* MySQL */
SELECT isValidIdNumber( 'G28667152' ); /* Returns 1 *//* JavaScript */
var isValid = isValidIdNumber( 'G28667152' ); /* Returns 1 *//* PHP */
$isValid = isValidIdNumber( 'G28667152' ); /* Returns 1 */-
1- If specified identification number is correct. -
0- Otherwise.
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.
This function is part of the NIF, NIE & CIF package.
Go back home!
SEPA validations
- [International Bank Account Numbers (IBAN)](International Bank Account Numbers (IBAN))
Spanish validations
- NIF, NIE & CIF
- [Spanish Bank Accounts](Spanish Bank Accounts)
Helpers
- [Common functions](Common functions)