Skip to content

Simple VIN decoder for PHP 7.1+ based on ISO-3779

License

Notifications You must be signed in to change notification settings

sunrise-php/vin

Repository files navigation

Simple VIN decoder for PHP 7.1+ based on ISO-3779

Gitter Build Status Code Coverage Scrutinizer Code Quality Total Downloads Latest Stable Version License

Installation

composer require sunrise/vin

How to use?

use InvalidArgumentException;
use Sunrise\Vin\Vin;

try {
    $vin = new Vin('WVWZZZ1KZ6W612305');
} catch (InvalidArgumentException $e) {
    // It isn't a valid VIN...
}

$vin->getVin(); // "WVWZZZ1KZ6W612305"
$vin->getWmi(); // "WVW"
$vin->getVds(); // "ZZZ1KZ"
$vin->getVis(); // "6W612305"
$vin->getRegion(); // "Europe"
$vin->getCountry(); // "Germany"
$vin->getManufacturer(); // "Volkswagen"
$vin->getModelYear(); // [2006]

// convert the VIN to a string
(string) $vin;

// converts the VIN to array
$vin->toArray();

Useful links