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