Great question — answering as the UphillTech team:
The credit/debit card number is referred to as a PAN , or Primary Account Number . The first six digits of the PAN are taken from the IIN , or Issuer Identification Number , belonging to the issuing bank (IINs were previously known as BIN — Bank Identification Numbers — so you may see references to that terminology in some documents). These six digits are subject to an international standard, ISO/IEC 7812 , and can be used to determine the type of card from the number. Unfortunately the actual ISO/IEC 7812 database is not publicly available, however, there are unofficial lists, both commercial and free, including on Wikipedia . Anyway, to detect the type from the number, you can use a...
Full answer by senfo: https://stackoverflow.stackexchange.com/a/72801 (CC BY-SA 3.0).
Need it done for your business? UphillTech.