PHP code example of chaoswey / taiwan-id-validator

1. Go to this page and download the library: Download chaoswey/taiwan-id-validator 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/ */

    

chaoswey / taiwan-id-validator example snippets


use Chaoswey\TaiwanIdValidator\Facades\TaiwanIdValidator;

TaiwanIdValidator::isGuiNumberValid('04595252', true); // 新版統一編號

TaiwanIdValidator::isGuiNumberValid('12345675'); // 統一編號
TaiwanIdValidator::isNationalIdentificationNumberValid('A123456789'); // 身分證字號
TaiwanIdValidator::isResidentCertificateNumberValid('AA00000009'); // 居留證編號 (舊式與新式)
TaiwanIdValidator::isNewResidentCertificateNumberValid('A800000014'); // 新式居留證編號
TaiwanIdValidator::isOriginalResidentCertificateNumberValid('AA00000009'); // 舊式居留證編號
TaiwanIdValidator::isCitizenDigitalCertificateNumberValid('AA12345678901234'); // 自然人憑證
TaiwanIdValidator::isEInvoiceCellPhoneBarcodeValid('/U.5+A33'); // 手機條碼
TaiwanIdValidator::isEInvoiceDonateCodeValid('001'); // 捐贈碼
TaiwanIdValidator::isCreditCardNumberValid('5105105105105100'); // 信用卡

use Chaoswey\TaiwanIdValidator\TaiwanIdValidator;

$valid = new TaiwanIdValidator();
$valid->isGuiNumberValid('04595252', true); // 新版統一編號

$valid->isGuiNumberValid('12345675'); // 統一編號
$valid->isNationalIdentificationNumberValid('A123456789'); // 身分證字號
$valid->isResidentCertificateNumberValid('AA00000009'); // 居留證編號 (舊式與新式)
$valid->isNewResidentCertificateNumberValid('A800000014'); // 新式居留證編號
$valid->isOriginalResidentCertificateNumberValid('AA00000009'); // 舊式居留證編號
$valid->isCitizenDigitalCertificateNumberValid('AA12345678901234'); // 自然人憑證
$valid->isEInvoiceCellPhoneBarcodeValid('/U.5+A33'); // 手機條碼
$valid->isEInvoiceDonateCodeValid('001'); // 捐贈碼
$valid->isCreditCardNumberValid('5105105105105100'); // 信用卡