Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for ( $in =606126702512472; $in < 606126702512572; $in++ ) {
- $digitos = str_split($in);
- foreach ($digitos as $i => $digito) {
- if ( ($i % 2) == 0 ) {
- $digitos[$i] = ($digito*2)>9 ? (($digito*2) - 9) : $digito*2;
- }
- }
- $suma = array_sum($digitos);
- if ( ($suma % 10) == 0 ) {
- $verificador = 0;
- } else {
- $verificador = (10 - ($suma%10));
- }
- echo $in."".$verificador;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement