sunrise / vin
VIN decoder for PHP 7.1+ based on ISO-3779
v1.3.0
2024-08-13 01:11 UTC
Requires
- php: ^7.1|^8.0
Requires (Dev)
- phpunit/phpunit: 7.5.20|9.5.0
- sunrise/coding-standard: 1.0.0
This package is auto-updated.
Last update: 2026-06-15 22:39:17 UTC
README
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
- https://en.wikipedia.org/wiki/Vehicle_identification_number
- https://en.wikibooks.org/wiki/Vehicle_Identification_Numbers_(VIN_codes)
- https://en.wikibooks.org/wiki/Vehicle_Identification_Numbers_(VIN_codes)/World_Manufacturer_Identifier_(WMI)
- https://en.wikibooks.org/wiki/Vehicle_Identification_Numbers_(VIN_codes)/Model_year