-
Notifications
You must be signed in to change notification settings - Fork 4
isValidIdNumber
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.
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 returns:
-
1
- If specified identification number is correct. -
0
- Otherwise.
/* MySQL */
SELECT isValidIdNumber( 'G28667152' );
//JavaScript
var isValid = isValidIdNumber( 'G28667152' );
/* PHP */
$isValid = isValidIdNumber( 'G28667152' );
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)