PHP code example of jakub-onderka / birth-number

1. Go to this page and download the library: Download jakub-onderka/birth-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/ */

    

jakub-onderka / birth-number example snippets


$birthNumber = new BirthNumber('736028/5163');

var_dump($birthNumber->getYear()); // 1973
var_dump($birthNumber->getMonth()); // 10
var_dump($birthNumber->getDay()); // 28
var_dump($birthNumber->getExtension()); // 516
var_dump($birthNumber->getChecksum()); // 3

var_dump($birthNumber->hasValidDate()); // true
var_dump($birthNumber->hasValidChecksum()); // true
var_dump($birthNumber->isValid()); // true

var_dump($birthNumber->getGender()); // female

var_dump($birthNumber->toString()); // 736028/5163