PHP code example of therezor / ua-tax-number

1. Go to this page and download the library: Download therezor/ua-tax-number library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

therezor / ua-tax-number example snippets




use TheRezor\UaTaxNumber\Decoder;

$inn = '3184710691';
// true
if (Decoder::isValid($inn)) {
    // "male"
    $gender = Decoder::gender($inn);
    // DateTime '1987-03-12'
    $birthDate = Decoder::birthDate($inn);
    // 33
    $age = Decoder::age($inn);
}



use TheRezor\UaTaxNumber\Decoder;

$inn = '3184710691';
// true
if (Decoder::isValid($inn)) {
    // "male"
    $gender = Decoder::gender($inn);
    // DateTime '1987-03-12'
    $birthDate = Decoder::birthDate($inn);
    // 33
    $age = Decoder::age($inn);
}



use TheRezor\UaTaxNumber\Decoder;

$inn = '3184710691';
// true
if (Decoder::isValid($inn)) {
    // "male"
    $gender = Decoder::gender($inn);
    // DateTime '1987-03-12'
    $birthDate = Decoder::birthDate($inn);
    // 33
    $age = Decoder::age($inn);
}