Jamesking56 Posted January 30, 2010 Report Share Posted January 30, 2010 Hi guys!I am designing a register form and I want to make it so that only letters (both cases), number and -=?!@:., are allowed.How can I check this in PHP? Link to comment Share on other sites More sharing options...
jeffman Posted January 30, 2010 Report Share Posted January 30, 2010 Try this:if (preg_match(/[^a-zA-Z0-9\-=?!@:.,]/, $str) ) {// bad name} Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now