parka Posted March 5, 2007 Share Posted March 5, 2007 This was an example from a book and it didn't work. Is there something wrong with the code or is it a php.ini thing? $username = 'parka'; $valid = ereg($username, '[[:alnum:] _-]{5,10}'); if (!$valid){ print "username is invalid"; } Quote Link to comment Share on other sites More sharing options...
Orio Posted March 5, 2007 Share Posted March 5, 2007 I'd rather use: $valid = eregi($username, '[a-z0-9_\-]{5,10}'); Orio. 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.