-
Notifications
You must be signed in to change notification settings - Fork 4
isValidNIF
elcapo edited this page Oct 16, 2014
·
4 revisions
isValidNIF
validates the check digits of an identification number, after verifying the string structure actually fits the NIF pattern.
/* MySQL */
SELECT isValidNIF( '11111111H' ); /* Returns 1 */
SELECT isValidNIF( '11111111X' ); /* Returns 0 */
/* JavaScript */
var isValid = isValidNIF( '11111111H' ); /* isValid = 1 */
var isValid = isValidNIF( '11111111X' ); /* isValid = 0 */
/* PHP */
$isValid = isValidNIF( '11111111H' ); /* $isValid = 1 */
$isValid = isValidNIF( '11111111X' ); /* $isValid = 0 */
-
1
- If specified NIF is correct. -
0
- Otherwise.
In order to verify the format of the string received as parameter, this function uses isValidNIFFormat
. In order to check the written digit and compare it with the correct one, it uses getNIFCheckDigit
.
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)