I'm not aware of any generic libraries that do this, but
it wouldn't be too hard to write your own:
$errmsg = validate_string( $name, 1, 20 ); // len must be between 1~20
$errmsg .= validate_email( $email );
$errmsg .= validate_numeric ($age, 18, 65 );
$errmsg .= validate_regex( $zipcode, '[0-9]{5}');
You get the idea: every validation function takes a value parameter
to be check along with the restrictions (e.g. min and max string length)
if any (e.g. in checking for a valid email address the criteria can be
hidden in the function itself.) validate_regex() provides a catchall
that can be as useful as your regex ability :-)
Each of the functions returns an error string, which can be concatenated
together as you perform the checks. A useful variant of this is to
provide a parameter for the error message (defaulted to a generic
message) so that you can be more specific:
$errmsg = validate_string( $name, 1, 20, "Name must be 20 chars or less" );