开发者

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...

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜