davey10101 Posted February 19, 2010 Share Posted February 19, 2010 Hi, I'm trying to make it so that the data allows characters for a name entry OR can be null string (so they don't have to give their name but if they do it must contain the obvious non numbers). Cheers... if(!preg_match("/^[A-Z a-z\s]{1,30}$/",$data[12])) Quote Link to comment Share on other sites More sharing options...
sader Posted February 20, 2010 Share Posted February 20, 2010 preg_match('/^[a-z ]{1,32}$/im', $str) Quote Link to comment Share on other sites More sharing options...
salathe Posted February 20, 2010 Share Posted February 20, 2010 Just change the 1 in {1,30} to 0. Quote Link to comment Share on other sites More sharing options...
davey10101 Posted February 20, 2010 Author Share Posted February 20, 2010 omg thats soooo obvious now. Had been coding all day and couldn't see it lol. Thanks Quote Link to comment Share on other sites More sharing options...
salathe Posted February 21, 2010 Share Posted February 21, 2010 Hehe no worries davey. Don't forget to mark the topic solved if it is. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.