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 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); 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
Archived
This topic is now archived and is closed to further replies.