for ($i = 0; $i < $length; $i++) $digit = (int)$reverse[$i];
// If the sum is a multiple of 10, the number is valid return ($sum % 10 === 0); cc checker script php
?>
// Double every second digit if ($i % 2 === 1) $digit *= 2; // If the result is > 9, subtract 9 if ($digit > 9) $digit -= 9; $sum += $digit; for ($i = 0; $i < $length; $i++)