PHP Classes

File: examples/simple-verifier.php

Recommend this page to a friend!
  Classes of Camilo Sperberg   PHP Valida RUT   examples/simple-verifier.php   Download  
File: examples/simple-verifier.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Valida RUT
Validate RUT Chilean numbers
Author: By
Last change: JavaScript is now loaded from another repository

Also updated composer.json with this new repository
Code cleanup
Date: 10 years ago
Size: 494 bytes
 

Contents

Class file image Download
<?php

include('../vendor/autoload.php');

$rutVerifier = new unreal4u\rutverifier();

var_dump($rutVerifier->isValidRUT('30.686.957-4'));
var_dump($rutVerifier->isValidRUT('30686957-4'));
var_dump($rutVerifier->isValidRUT('306869574'));

var_dump($rutVerifier->isValidRUT('30.686.957-0'));

var_dump($rutVerifier->formatRUT('30.686.957-0', false));

echo
$rutVerifier.'<br />'.PHP_EOL;

// Include javascript validation with the following function:
echo $rutVerifier->constructJavascript();