Skip to content

Validation Server side

schnoog edited this page Dec 29, 2017 · 1 revision

Server side validation

The validation of input strings is performed by the class werx/validation

The validation of a single input string can be done by the function

function validateInput($inputarray,$inputfield,$label,$rule) 

Example

$inputfield = "FieldX";
$inputarray[$inputfield] = "Value2Check";
$label = "A required label, don''t leave it empty";
$rule='required|exactlength[10]|alphanumeric';
$result  = validateInput($inputarray,$inputfield,$label,$rule);

The result in this case would be true.

Clone this wiki locally