Skip to content

Instantly share code, notes, and snippets.

@russellfeeed
russellfeeed / Luhn
Last active December 23, 2015 20:09
<?php
function luhnFromProcessImeis($str)
{
$str = (string)$str;
$odd = !strlen($str)%2;
$sum = 0;
for($i=0;$i<strlen($str);++$i) {
$n=0+$str[$i];