tesla-software / oib
Validate, generate OIB (Croatian Personal Identification Number)
v1.0.0
2021-02-01 22:50 UTC
Requires
- php: ^7.3|^8.0
Requires (Dev)
- phpunit/phpunit: >=9.0
- squizlabs/php_codesniffer: ^3.4
This package is auto-updated.
Last update: 2024-11-10 17:57:41 UTC
README
Validate OIB (Personal Identification Number).
Install
Via Composer
composer require tesla-software/oib
Usage
Validation
use Tesla\OIB\OIB; // Check if OIB is valid OIB::validate('00000000001'); // Returns: bool
Validation of multiple OIB's
// Check if OIB's are valid OIB::validateMany('00000000001', '00000000002', ...); // Returns: array // or OIB::validateMany(['00000000001', '00000000002', ...]); // Returns: array /** * Results * [ "73963178454" => false "25878484848" => false "73963178454AA" => false "25878484848ZZ" => false "87783564545" => false "87783564545GG" => false "12345678911" => true "91145678919" => true "87884784457" => true "87871118443" => true "36875454458" => true "78745548455" => true ] */
Testing
composer test