if ($rut == ""){ $verificado=false; return $verificado; }
$x=2; $sumatorio=0; for ($i=strlen($rut)-1;$i>=0;$i--){ if ($x>7){$x=2;} $sumatorio=$sumatorio+($rut[$i]*$x); $x++; } $digito=$sumatorio%11; $digito=11-$digito;
switch ($digito){ case 10: $digito="k"; break; case 11: $digito="0"; break; }
if (strtolower($digito_v)==$digito){ $verificado=true; } else { $verificado=false; }
return $verificado; }
$rut="el_rut"; // aqui el RUT $digito="digito_verificador"; // aqui el digito verificador.
if (validar_rut($rut,$digito)){ echo "RUT correcto"; }else{ echo "RUT no valido"; }
it can be easily done in JS, but don't know how to do it in cf
thanks in advance
------------------------------ I'm sick of all you hypocrites holding me at bay And I don't need your sympathy to get me through the day. A Change Of Seasons.
oh! dam i forgot... the code is in php didn't add the <?php the_code ?>
sorry... ^_^
------------------------------ I'm sick of all you hypocrites holding me at bay And I don't need your sympathy to get me through the day. A Change Of Seasons.