views:

45

answers:

3

I'm trying to find a list of good validation libraries (phone, email, etc.) that are constantly being maintained. I use PHP and am open to libraries from frameworks, but if you recommend a library from a framework, please say whether it allows you to use it without the framework itself?

+3  A: 

You could give a go to Zend_Validate

http://framework.zend.com/manual/en/zend.validate.introduction.html

With the Zend framework, you can choose to use whichever part of the framework you like. If you go for very basic validation, it can be as simple as static calls to predefined methods such as:

if (Zend_Validate::is($email, 'EmailAddress')) {
    // Yes, email appears to be valid
}

Otherwise you also have the option of building custom validators of your own design.

Guillaume Bodi
+2  A: 

There is also the PEAR library Validate here.

Mitch C
+1  A: 

Whats wrong with filter_var?

YuriKolovsky