ricardonavarrom/vatin-validator

A PHP library for for validating VAT identification numbers (VATINs).

1.1.2 2016-10-15 11:08 UTC

This package is not auto-updated.

Last update: 2024-11-13 21:01:11 UTC


README

Build Status Coverage Status Total Downloads SensioLabsInsight

A PHP library for for validating VAT identification numbers (VATINs).

Installation

This library is available on Packagist.

You can install this library using composer

$ composer require ricardonavarrom/vatin-validator

or add the package to your composer.json file directly.

Basic usage

This library provides multiple located validators (view availables locales section).

$vatin = '56475114V';
$locatedValidator = new VATINValidatorES();
$vatinIsValid = $locatedValidator->validate($vatin);

Some located validators provides specials validations methods for its country.

$nif = '75096482X';
$nie = 'Z4503838Y';
$cif = 'A83472787';
$locatedValidator = new VATINValidatorES();
$nifIsValid = $locatedValidator->validateNIF($nif);
$nieIsValid = $locatedValidator->validateNIE($nie);
$cifIsValid = $locatedValidator->validateCIF($cif);

Availables locales