1. Go to this page and download the library: Download olssonm/identity-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/ */
olssonm / identity-number example snippets
use Olssonm\IdentityNumber\IdentityNumberFormatter;
// Format to a 10-character PIN without a seperator
$formatter = new IdentityNumberFormatter('19860210-7313', 10, false);
// Get the formatted output
$formatter->getFormatted(); // 8602107313
// You can also clean the number from all unwanted characters
(new IdentityNumberFormatter('a19860210 - 7313', 12, true))->clean()->getFormatted(); // 19860210-7313