PHP code example of byrokrat / checkdigit
1. Go to this page and download the library: Download byrokrat/checkdigit 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/ */
byrokrat / checkdigit example snippets
$luhn = new byrokrat\checkdigit\Luhn;
// outputs '1' (true)
echo $luhn->isValid('55555551');
// outputs '' (false)
echo $luhn->isValid('55555550');
// outputs '1'
echo $luhn->calculateCheckDigit('5555555');