djessy / nl-tools
A PHP Composer package with useful utilities for Dutch developers.
Requires
None
Requires (Dev)
- phpunit/phpunit: ^13.3
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-10-13 12:02:06 UTC
README
NL-Tools is a PHP Composer package containing reusable utilities for common Dutch data formats and conventions.
The package focuses on simple validation and formatting utilities that can be used in PHP applications without additional dependencies.
Installation
Install NL-Tools using Composer:
composer require djessy/nl-tools
Requirements
- PHP 8.5 or higher
- Composer
Features
- Dutch postal code validation and formatting
- Dutch IBAN format validation
- Dutch VAT number format validation
- Dutch license plate validation
- Dutch holidays and special days
- Dutch mobile phone number validation
Usage
Postal codes
use Djessy\NlTools\Postcode; $postcode = new Postcode(); $postcode->validatePostalCode('5038EA'); // true $postcode->formatPostalCode('5038ea'); // 5038 EA
IBAN
use Djessy\NlTools\Iban; $iban = new Iban(); $iban->validateIban('NL43ABNA0417164322'); // true
IBAN validation currently checks the Dutch IBAN format. Full IBAN checksum validation is not currently implemented.
VAT numbers
use Djessy\NlTools\Btw; $btw = new Btw(); $btw->validateBtw('NL123456789B01'); // true
License plates
use Djessy\NlTools\Kenteken; $kenteken = new Kenteken(); $kenteken->validateKenteken('AB-12-34'); // true
Holidays
use Djessy\NlTools\Feestdagen; $feestdagen = new Feestdagen(); $feestdagen->getFeestdagen(2026);
This returns the supported Dutch holidays and special days for the requested year.
Phone numbers
use Djessy\NlTools\Telefoonnummer; $telefoonnummer = new Telefoonnummer(); $telefoonnummer->validateTelefoonnummer('06-12345678'); // true
International Dutch mobile numbers are also supported:
$telefoonnummer->validateTelefoonnummer('+31 6 12345678'); // true
Testing
NL-Tools uses PHPUnit for automated testing.
Run the test suite with:
vendor/bin/phpunit
The current test suite contains 222 tests and 239 assertions.
Project Structure
NL-Tools/
├── src/
│ ├── Btw.php
│ ├── Feestdagen.php
│ ├── Iban.php
│ ├── Kenteken.php
│ ├── Postcode.php
│ └── Telefoonnummer.php
├── tests/
│ ├── BtwTest.php
│ ├── FeestdagenTest.php
│ ├── IbanTest.php
│ ├── KentekenTest.php
│ ├── PostcodeTest.php
│ └── TelefoonnummerTest.php
├── composer.json
├── phpunit.xml
├── LICENSE
└── README.md
Contributing
Contributions are welcome.
If you find a bug, have a suggestion, or want to add another Dutch utility, feel free to open an issue or submit a pull request.
Before contributing, please read the Code of Conduct.
Security
If you discover a security vulnerability, please do not report it through a public GitHub issue.
Please see SECURITY.md for information about responsible vulnerability reporting.
License
NL-Tools is open-source software licensed under the MIT License.
Author
Djessy van Drunen OWNER
- GitHub: @djessy-vd
- Website: djessy.eu
Kyan Leijten
- ideas for the banner Kyan leijten
If you find this package useful, consider giving the repository a star.