PHP code example of vishowsky / rutvalidator
1. Go to this page and download the library: Download vishowsky/rutvalidator library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
vishowsky / rutvalidator example snippets
use App\Libraries\RUTValidator;
$rut = '123456789';
$rutFormateado = RUTValidator::formatearRut($rut);
use App\Libraries\RUTValidator;
$rut = "12.345.678-9";
if (RUTValidator::validarRut($rut)) {
echo "El RUT es válido";
} else {
echo "El RUT es inválido";
}
use App\Libraries\RUTValidator;
$rut = '123456789';
$dv = RUTValidator::obtenerDigitoVerificador($rut);
$rut = '12.345.678-9';
$rutLimpio = RUTValidator::limpiarRut($rut);