Create a factory of rules with Pimf_Util_Validator
$attributes = array(
'fname' => 'conan',
'age' => 33,
'birth' => '12-12-2040',
'monitor' => 'sonyT2000',
);
$rules = array(
'fname' => 'alpha|length[>,0]|lengthBetween[1,9]',
'age' => 'digit|value[>,18]|value[=,33]',
'birth' => 'length[>,0]|date[mm-dd-yyyy]',
'monitor' => 'alphaNumeric'
);
$validator = Pimf_Util_Validator::factory($attributes, $rules);
//...
$validator->getErrors();
$validator->getErrorMessages();Written by Gjero Krsteski
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Php
Authors
Did you know?
PHP applications still send a browser full of JavaScript. Hardening the server does not inventory the payment, analytics, and plugin scripts that run after the HTML is delivered.
Security insights from Cside
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#