PHP library to validate and format license plate numbers.

Overview

License plate validator and formatter

All Contributors

CI Status
Lint Lint
Coverage Coverage
Tests Tests

This library can be used to validate and format license plate numbers.

Countries supported

Europe

  • Belgium (1971-now)
  • Finland (1922-now)
  • France (1976-now)
  • Germany (unknown date-now)
  • Italy (1994-now)
  • Luxembourg (unknown date-now)
  • Netherlands (1951-now)
  • Spain (1900-now)
  • United Kingdom (1903-now)

Asia

  • Israel (unknown date-now)

Africa

  • Central African Republic (2006-now)
  • Gabon (1962-now)

More

  • More countries will be added in the future

How to install

composer require automex/amex-license-plate-formatter-php

Or add the following to your composer.json:

{
    "require": {
        "automex/amex-license-plate-formatter-php": "^1.0.0"
    }
}

How to use

Call the constructor of the license plate class of your choice with the user input as the first parameter:


$licenseplate = new \Amex\LicensePlate\DutchLicensePlate('08ttnp');
if($licenseplate->isValid())
{
    echo $licenseplate->format(); // Outputs 08-TT-NP in this case
}

Since the license plate classes for each country implement the LicensePlateInterface, they expose isValid() and format() methods. Country-specific methods may also be available. Please check the code of the specific class to get the complete picture.

Please note that this library does not check if a license plate actually exists, nor does it exclude combinations that aren't allowed.

License

The code and the documentation are released under the LPGLv2.1 License.

Contributors

Thanks goes to these wonderful people (emoji key):


Patrick Groot

🚇 ⚠️ 💻

This project follows the all-contributors specification. Contributions of any kind welcome!

You might also like...
Valitron is a simple, elegant, stand-alone validation library with NO dependencies

Valitron: Easy Validation That Doesn't Suck Valitron is a simple, minimal and elegant stand-alone validation library with NO dependencies. Valitron us

[READ-ONLY] Validation library from CakePHP. This repo is a split of the main code that can be found in https://github.com/cakephp/cakephp

CakePHP Validation Library The validation library in CakePHP provides features to build validators that can validate arbitrary arrays of data with eas

Library that offers Input Filtering based on Annotations for use with Objects. Check out 2.dev for 2.0 pre-release.

DMS Filter Component This library provides a service that can be used to filter object values based on annotations Install Use composer to add DMS\Fil

An extensible validation library for your data with sane defaults.
An extensible validation library for your data with sane defaults.

Hird Hirds, also known as housecarls, was a gathering of hirdmen, who functioned as the king's personal guards during the viking age and the early mid

A re-write of rakit/validation, a standalone validation library inspired by Laravel Validation

Somnambulist Validation This is a re-write of rakit/validation, a standalone validator like Laravel Validation. In keeping with rakit/validation, this

Modern PHP validator on steroids for validating forms and/or array's.

Modern PHP Validator - Standalone Validation on Steroids Introduction Head first example Installation Adding fields for validation Execute validation

File uploads with validation and storage strategies

Upload This component simplifies file validation and uploading. Usage Assume a file is uploaded with this HTML form: form method="POST" enctype="mult

Abstracts HTTP request input handling, providing an easy interface for data hydration and validation

Linio Input Linio Input is yet another component of the Linio Framework. It aims to abstract HTTP request input handling, allowing a seamless integrat

Improved abstraction for dealing with union and named types.
Improved abstraction for dealing with union and named types.

Check whether a reflection type or method accepts a given input

Releases(v1.1.2)
Owner
Automex.website
Automex.website
PHP library to validate and convert ISBNs and EANs

biblys/isbn biblys/isbn can be used to: validate a string against the ISBN-10, ISBN-13 and EAN-13 formats convert an ISBN to ISBN-10, ISBN-13, EAN-13

Biblys 48 Apr 10, 2022
Validate and sanitize arrays and objects.

Aura.Filter This package provides tools to validate and sanitize objects and arrays. Foreword Installation This library requires PHP 5.4 or later; we

Aura for PHP 153 Jan 2, 2023
This package provides tools to validate and sanitize objects and arrays.

Aura.Filter This package provides tools to validate and sanitize objects and arrays. Foreword Installation This library requires PHP 7.2 or later; we

Aura for PHP 153 Jan 2, 2023
A simple package to validate against common passwords and help keep your application secure.

common-passwords A simple package to validate against common passwords and help keep your application secure. composer require crumbls/common-password

Crumbls 4 Oct 16, 2021
Lightweight and feature-rich PHP validation and filtering library. Support scene grouping, pre-filtering, array checking, custom validators, custom messages. 轻量且功能丰富的PHP验证、过滤库。支持场景分组,前置过滤,数组检查,自定义验证器,自定义消息。

PHP Validate 一个简洁小巧且功能完善的php验证、过滤库。 简单方便,支持添加自定义验证器 支持前置验证检查, 自定义如何判断非空 支持将规则按场景进行分组设置。或者部分验证 支持在进行验证前对值使用过滤器进行净化过滤内置过滤器 支持在进行验证前置处理和后置处理独立验证处理 支持自定义每

Inhere 246 Jan 5, 2023
PHP library for ArCaptcha. This package supports PHP 7.3+.

PHP ArCaptcha Library PHP library for ArCaptcha. This package supports PHP 7.3+. List of contents PHP ArCaptcha Library List of contents Installation

Mohammad Abbasi 10 Aug 12, 2022
Light and extendable schema validation library

Light PHP validation library For everyone who uses MongoDB or other NoSQL solution and cares about what client sends to his/her database and looking f

Alexander Serkin 43 Sep 28, 2022
A simple filtering library for PHP

Filterus - A flexible PHP 5.3 filter package Filter Methods: Each filter class has two primary methods: $filter->filter($var) - returns a modified ver

Anthony Ferrara 451 Dec 27, 2022
PHP Email address validator - A library for validating emails against several RFC.

EmailValidator A library for validating emails against several RFC. Supported RFCs This library aims to support RFCs: 5321, 5322, 6530, 6531, 6532, 10

Eduardo Gulias Davis 10.7k Jun 13, 2022
FyreValidation is a free, open-source validation library for PHP.

FyreValidation FyreValidation is a free, validation library for PHP. Table Of Contents Installation Validators Rules Error Messages Installation Using

Elusive 0 Jan 15, 2022