PHP code example of trejjam / validation
1. Go to this page and download the library: Download trejjam/validation 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/ */
trejjam / validation example snippets
/**
* @var \Trejjam\Validation @inject
*/
public $validation;
function renderDefault() {
//offline check
$rcValid=$this->validation->rc("780123/3540"); //problematic RČ
$icValid=$this->validation->ic("25596641"); //problematic IČ
//online check
$icValidOnline = $this->validation->aresIc("27604977"); //google IČ
dump($rcValid);
/*
dump boolean
TRUE
*/
dump($icValid);
/*
dump boolean
TRUE
*/
dump($icValidOnline);
/*
dump stdClass
ico => "27604977" (8)
dic => "CZ27604977" (10)
firma => "Google Czech Republic, s.r.o." (29)
ulice => "Stroupežnického" (17)
cisloOrientacni => "17" (2)
cisloPopisne => "3191" (4)
cisloMesto => "Praha" (5)
castObce => "Smíchov" (8)
psc => "15000" (5)
*/
}