i lost my phone 2 days ago. i also serch about this very much, then i found details provided by you. it is really useful. thanks....
function imei_check($strDigits){
$sum = 0;
$alt = false;
for($i = strlen($strDigits) - 1; $i >= 0; $i--)
{
if($alt)
{
$temp = $strDigits[$i];
$temp *= 2;
$strDigits[$i] = ($temp > 9) ? $temp = $temp - 9 : $temp;
}
$sum += $strDigits[$i];
$alt = !$alt;
}
return $sum % 10 == 0;
}
මේ function එකෙන් luhn validate කරනවා.
onenam IMEI eke thiyena digits 15 da kiyalath meka athulema check karanna puluwan.
if (strlen($strDigits) != 15) {
return FALSE;
}
