PHP code example of freelancehunt / php-credit-card-validator

1. Go to this page and download the library: Download freelancehunt/php-credit-card-validator 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/ */

    

freelancehunt / php-credit-card-validator example snippets


$card = CreditCard::validCreditCard('5500005555555559', CreditCard::TYPE_MASTERCARD);
print_r($card);

$card = CreditCard::validCreditCard('5500005555555559', [CreditCard::TYPE_VISA, CreditCard::TYPE_MASTERCARD]);
print_r($card);

$card = CreditCard::validCreditCard('371449635398431');
print_r($card);

$validCvc = CreditCard::validCvc('234', CreditCard::TYPE_VISA);
var_dump($validCvc);

$validDate = CreditCard::validDate('2013', '07'); // past date
var_dump($validDate);
json
""freelancehunt/php-credit-card-validator": "3.*"
},