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

Folders and files

NameName
Last commit message
Last commit date
Apr 19, 2022
Apr 29, 2021
Mar 8, 2024
Apr 19, 2022
Apr 19, 2022
Apr 19, 2022
Apr 19, 2022
Apr 19, 2022
Apr 19, 2022
Apr 19, 2022
Apr 19, 2022
Jul 5, 2019
Apr 19, 2022
Apr 19, 2022
Oct 17, 2018

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