PHP code example of urbanproof / faker-finnish-idents

1. Go to this page and download the library: Download urbanproof/faker-finnish-idents 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/ */

    

urbanproof / faker-finnish-idents example snippets


$faker = (new \Faker\Factory())::create();
$faker->addProvider(new Urbanproof\FakerIdents\IdentProvider($faker));

echo $faker->companyIdent; // => "5235981-6"

echo $faker->personIdent; // => "170379-921F"

echo $faker->personIdent(DateTime::createFromFormat('d.m.Y', '01.01.2000'); // => "010100A3967"

use const Urbanproof\FakerIdents\GENER_MALE;
echo $faker->personIdent(DateTime::createFromFormat('d.m.Y', '31.12.1999'), GENER_MALE); // => "311299-4059"