PHP code example of nekoos / credit-card-validator

1. Go to this page and download the library: Download nekoos/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/ */

    

nekoos / credit-card-validator example snippets


    visa
    mastercard
    amex
    dinersclub
    discover
    unionpay
    jcb
    visaelectron
    maestro
    forbrugsforeningen
    dankort

$card = NekoOs\Validator\Support\Facades\CreditCard::isValidNumber('371449635398431');
print_r($card);

$card = NekoOs\Validator\Support\Facades\CreditCard::isValidNumber('371449635398431', 'mastercard');
print_r($card);

$validDate =  NekoOs\Validator\Support\Facades\CreditCard::isValidDate('2024-04');
var_dump($validDate);

$validCvc = NekoOs\Validator\Support\Facades\CreditCard::isValidCvc(234, 'visa');
var_dump($validCvc);