<?php
require 'validation.class.php';
$validation = new validation;
/**
* we add here strings for validation. first param is the name, and the second content
*/
$validation
-> setString('first_string', 'String with polish chars, example: ó³æñ')
-> setString('second_string', '') //this string don't valid, because some content is required [required( true)]
-> setString('third_string', 'short string');
/**
* we add rules
*/
$validation
-> setValidations( 'first_string') -> minlenght( 15) -> maxlenght( 1574)
-> setValidations( 'second_string') -> required( true)
-> setValidations( 'third_string') -> required( true) -> type( 'string') -> between( array( 10,1587)) -> start();
//chech whether valid
echo ($validation -> isValid( array( 'first_string', 'second_string', 'third_string'))) ? 'Przesz³o test' : 'Nie przesz³o testu';
//return array with errors
print_r( $validation -> error);