PHP code example of kurothing / kurovalidator
1. Go to this page and download the library: Download kurothing/kurovalidator 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/ */
kurothing / kurovalidator example snippets
use KuroThing\KuroValidator\Validator;
$validator = new Validator();
$result = $validator->validate($_GET, [
"field" => [
"rules" => [
"rule" => "rule setting",
"rule2" => [
"MultiValue" => "settings",
"AreSupported" => true,
],
],
],
]);
if ($result->passes()) {
// Passes
} else {
// Fails
}
// Or the reverse
if ($result->fails()) {
// Fails
} else {
// Passes
}