Home >php教程 >PHP源码 >依据银行卡号获取银行信息php代码

依据银行卡号获取银行信息php代码

PHP中文网
PHP中文网Original
2016-05-26 08:19:531666browse

        跳至                            

<?php
/**
 *
 * bank.php文件
 *
 * User: Administrator
 * DateTime: 2014/12/31 10:01
 */
header(&#39;Content-type:text/html;charset=utf-8&#39;);
require_once(&#39;bankList.php&#39;);
function bankInfo($card,$bankList)
{
//		$card = &#39;6222021001116245702&#39;;
//    $card = &#39;6228481552887309119&#39;;
//    $bankList = Config::get(&#39;bankList&#39;);
    $card_8 = substr($card, 0, 8);
    if (isset($bankList[$card_8])) {
        echo $bankList[$card_8];
        return;
    }
    $card_6 = substr($card, 0, 6);
    if (isset($bankList[$card_6])) {
        echo $bankList[$card_6];
        return;
    }
    $card_5 = substr($card, 0, 5);
    if (isset($bankList[$card_5])) {
        echo $bankList[$card_5];
        return;
    }
    $card_4 = substr($card, 0, 4);
    if (isset($bankList[$card_4])) {
        echo $bankList[$card_4];
        return;
    }
    echo &#39;该卡号信息暂未录入&#39;;
}

bankInfo(&#39;6228481552887309119&#39;,$bankList);

                                       

                   

2. [文件] bankList.php ~ 184KB      

                           

       

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn