<?php
include "leopardValidator.php";
$result = leopardValidator::validate(array(
rules::NOTEMPTY,
rules::MINS => 2),
"Some text to validate");
if($result){
echo "All is ok";
} else {
//$result is array of don't met rules
foreach($result as $rule){
echo $rule["rule"];
//in this example is argument by rule - rules::MINS
if(isset($rule["argument"])
echo $rule["argument"];
}
}
?>
|