PHP code example of questocat / bank-card

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

    

questocat / bank-card example snippets


$bankCard = new BankCard('620043459807747768');

// 获取银行卡详细信息
$bankCard->info();

// 返回值
[
    'bank_name' => '福建海峡银行',     // 银行名称
    'short_code' => 'FJHXBC',        // 银行简码
    'card_type_name' => '储蓄卡',     // 银行卡类型
    'card_type' => 'DC',             // 银行卡类型代码
    'length' => 19,                  // 银行卡号位数
    'validated' => true,             // 卡 BIN 验证情况
    'luhn' => false,                 // Luhn 校验
    'logo' => 'https://apimg.alipay.com/combo.png?d=cashier&t=FJHXBC',   // 银行 Logo
]

// 根据指定的银行简码,获取银行 Logo
$bankCard->logo('CCB');