how to do special character validation in PHP
I have lot of textarea fields to add comments and quotes. How can I 开发者_高级运维validate these fields. I checked null validation other than null validation what validation I have to do?
Some things you need to check :
empty values
numbers only
input length
email address
strip html tags
Credit : php-mysql-tutorial.com
!empty( $text ) && strlen( $text ) > 123 && !preg_match('/(<[a-z]+>)/', $text )
... and so on...
精彩评论