wucdbm/credit-card-guesser
Composer 安装命令:
composer require wucdbm/credit-card-guesser
包简介
A yet another credit card type guesser
README 文档
README
<?php // Guess card type $guesser = new \Wucdbm\CreditCardGuesser\TypeGuesser(); try { $type = $guesser->guess('1234 1234 1234 1234'); } catch (\Wucdbm\CreditCardGuesser\Exception\UnknownCardTypeException $e) { // failed to match any of the built-in types } // Change Code for a particular card type $guesser->setCode('Visa', 'SomeOtherCode'); // Change Regex for a particular card type $guesser->setRegex('Visa', '/anotherRegex1234567/'); // Add another card type $guesser->addCard('VisaElectron', 'VI', '/someRegex/'); // Remove card type $guesser->removeCard('Visa');
A word on Regex expressions
Regexes have been collected from the following libraries
Contribution
If you need another card type to be included in the standard config, please submit a PR
统计信息
- 总下载量: 5.64k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-08-13