Jamesking56 Posted January 30, 2010 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 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
Archived
This topic is now archived and is closed to further replies.