PHP code example of serima / mynumber

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

    

serima / mynumber example snippets


use Serima\MyNumber\MyNumber;

// 個人番号(12桁・末尾がチェックデジット)
MyNumber::verifyPersonal('123456789018'); // true
MyNumber::verifyPersonal('123456789019'); // false

// 先頭が 0 の場合は文字列で渡してください
MyNumber::verifyPersonal('023456789013'); // true

// 法人番号(13桁・先頭がチェックデジット)
MyNumber::verifyCompany('7000012050002'); // true(国税庁の法人番号)
MyNumber::verifyCompany('7000012050003'); // false