Posts Tagged ‘algorithm

Sorting PHP arrays using usort with substrings

The Luhn algorithm also known as the “modulus 10″ or “mod 10″ algorithm, is a checksum formula which can be used to validate credit card numbers. Developed in the 1950’s by IBM scientist Hans Peter Luhn and described in U.S. Patent 2,950,048. A PHP implementation is shown below.

 
function LuhnCheck($strDigits)
{
$sum = 0;
[...]


RECENT COMMENTS

ON TWITTER