Skip to content

Luhn Algorithm Implementation to validate Debit & Credit Cards & IMEI numbers.

License

Notifications You must be signed in to change notification settings

ShaheryarMahmod/LuhnAlgorithm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Luhn Algorithm - PHP

Luhn Algorithm Implementation in PHP to validate Debit & Credit Cards & IMEI numbers.

Composer

composer require shaheryarmahmod/luhnalgorithm

Example

<?php
require_once 'vendor/autoload.php';

use ShaheryarMahmod\LuhnAlgorithm;

$number = 4111111111111111;

// Check digit calculation
var_dump(LuhnAlgorithm::checksum($number));  // int(1)

// Validate numbers
var_dump(LuhnAlgorithm::isValid($number));   // bool(true)

About

Luhn Algorithm Implementation to validate Debit & Credit Cards & IMEI numbers.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages