PHP code example of miladk / bekrafta

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

    

miladk / bekrafta example snippets


use Bekrafta\PersonalNumber;

$oPN = new PersonalNumber('811228-9874');

// True on successful detection, false otherwise.
// True also means a valid personal number.
$oPN->detect();

// 811228-****
$oPN->getCensored();

// 35
$oPN->getAge();

// m
$oPN->getGender();

// 1981
$oPM->getYear();

// 1981-12-28
$oPM->getBirthday()

use Bekrafta\Sweden;

$oSweden = new Sweden('811228-9874');

// True on valid personal number, false otherwise.
$oSweden->validate();

// 811228-****
$oSweden->getCensored();

// 35
$oSweden->getAge();

// m
$oSweden->getGender();

// 1981
$oSweden->getYear();

// 1981-12-28
$oSweden->getBirthday();