require_once "Zend/Validate.php";
require_once "Zend/Validate/StringLength.php";
$validator = new Zend_Validate_StringLength(5);
$input = "Coming Here";
if($validator->isValid($input)){
// success code
}else{
// error code
echo current($validator->getMessages());
}
No comments:
Post a Comment