1. Go to this page and download the library: Download designbycode/luhn-algorithm 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/ */
designbycode / luhn-algorithm example snippets
$luhn = new LuhnAlgorithm();
$isValid = $luhn->isValid('79927398713'); // returns true
$luhn = new LuhnAlgorithm();
$generatedCheckDigit = $luhn->generate('7992739871'); // returns '79927398713'
$luhn = new LuhnAlgorithm();
$valueWithoutDigit = $luhn->withoutDigit('79927398713'); // returns '7992739871'