markthien Posted April 6, 2009 Share Posted April 6, 2009 Hi guys, I need to check if user enter only alphabet, numeric, hypen and underscore like "mark_thien-01", "markthien" or "mark0" or "mark_1" is valid. Appreciate any help please. Thanks & Regards, Mark Thien Quote Link to comment https://forums.phpfreaks.com/topic/152827-how-to-accept-input-with-only-alphabet-numeric-hypen-and-underscore/ Share on other sites More sharing options...
charleshill Posted April 6, 2009 Share Posted April 6, 2009 $data = ereg_replace('[^a-zA-Z0-9_-]', '', $data); Quote Link to comment https://forums.phpfreaks.com/topic/152827-how-to-accept-input-with-only-alphabet-numeric-hypen-and-underscore/#findComment-802611 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.