: This article mainly describes how to determine the ownership of a bank card number. For more information about PHP tutorials, see. Header ('content-type: text/html; charset = utf-8 ');
Require_once ('banklist. php ');
Function bankInfo ($ card, $ bankList)
{
$ 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 'The card no. has been input ';
}
Echo bankInfo ('20140901', $ bankList );
Address: http://www.jb51.net/article/65178.htm
The above describes how to determine the ownership of the bank card number, including the content, and hope to help friends who are interested in the PHP Tutorial.