PHP Special Characters Test
Posted
by pws5068
on Stack Overflow
See other posts from Stack Overflow
or by pws5068
Published on 2010-04-16T01:08:53Z
Indexed on
2010/04/16
1:13 UTC
Read the original article
Hit count: 436
What's an efficient way of checking if a username contains a number of special characters that I define.
Examples: % # ^ . ! @ & ( ) + / " ? ` ~ < > { } [ ] | = - ;
I need to detect them and return a boolean, not just strip them out.
Probably a super easy question but I need a better way of doing this than a huge list of conditionals or a sloppy loop.
© Stack Overflow or respective owner