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

isValidNIE validates the check digits of an identification number, after verifying the string structure actually fits the NIE pattern.

Usage

/* MySQL */
SELECT isValidNIE( 'X6089822C' ); /* Returns 1 */
SELECT isValidNIE( 'X6089822X' ); /* Returns 0 */
/* JavaScript */
var isValid = isValidNIE( 'X6089822C' ); /* isValid = 1 */
var isValid = isValidNIE( 'X6089822X' ); /* isValid = 0 */
/* PHP */
$isValid = isValidNIE( 'X6089822C' ); /* $isValid = 1 */
$isValid = isValidNIE( 'X6089822X' ); /* $isValid = 0 */

Return values

  • 1 - If specified NIE is correct.
  • 0 - Otherwise.

Dependencies

In order to verify the format of the string received as parameter, this function uses isValidNIEFormat. In order to check the written digit, it actually uses isValidNIF.

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