PHP code example of hitobias / twid

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

    

hitobias / twid example snippets


'aliases' => [
	...
    
    'Twid' => Meditate\IdentityCard\Facades\TaiwanIdentityCard::class,
]

use Meditate\IdentityCard\TaiwanIdentityCard;

$taiwanIdCard = new TaiwanIdentityCard;

$taiwanIdCard->check('A123456789'); // true
$taiwanIdCard->check('A223456789'); // false

// A123456789
$taiwanIdCard->make();

// B167663827
$taiwanIdCard->make('B');

// A259776352
$taiwanIdCard->make('A', 2);

Twid::check('A123456789');

Twid::make();

public function rules()
{
    return [
        'id_number' => 'tw_id'
    ];
}