https://github.com/sunrise-php/vin
Simple VIN decoder for PHP 7.1+ based on ISO-3779
https://github.com/sunrise-php/vin
iso-3779 php-library php7 php8 vin vin-codes vin-decoder
Last synced: about 1 year ago
JSON representation
Simple VIN decoder for PHP 7.1+ based on ISO-3779
- Host: GitHub
- URL: https://github.com/sunrise-php/vin
- Owner: sunrise-php
- License: mit
- Created: 2018-10-16T14:18:20.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2025-05-11T09:33:12.000Z (about 1 year ago)
- Last Synced: 2025-05-11T10:29:09.535Z (about 1 year ago)
- Topics: iso-3779, php-library, php7, php8, vin, vin-codes, vin-decoder
- Language: PHP
- Homepage:
- Size: 85.9 KB
- Stars: 79
- Watchers: 6
- Forks: 25
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## Simple VIN decoder for PHP 7.1+ based on ISO-3779
[](https://gitter.im/sunrise-php/support)
[](https://circleci.com/gh/sunrise-php/vin)
[](https://scrutinizer-ci.com/g/sunrise-php/vin/?branch=master)
[](https://scrutinizer-ci.com/g/sunrise-php/vin/?branch=master)
[](https://packagist.org/packages/sunrise/vin)
[](https://packagist.org/packages/sunrise/vin)
[](https://packagist.org/packages/sunrise/vin)
## Installation
```bash
composer require sunrise/vin
```
## How to use?
```php
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