android6011 Posted April 14, 2008 Share Posted April 14, 2008 is there a function that checks for special charactars? I want an input of only numbers and letters for a username so Im not sure the best mthod for making sure only numbers or letters have been entered Link to comment https://forums.phpfreaks.com/topic/101119-check-for-special-characters/ Share on other sites More sharing options...
BlueSkyIS Posted April 14, 2008 Share Posted April 14, 2008 if (ereg('^[A-Za-z0-9]+$', $user_name)) { echo "$user_name IS all numbers and letters."; } else { echo "$user_name IS NOT all numbers and letters."; } Link to comment https://forums.phpfreaks.com/topic/101119-check-for-special-characters/#findComment-517149 Share on other sites More sharing options...
android6011 Posted April 14, 2008 Author Share Posted April 14, 2008 thank you Link to comment https://forums.phpfreaks.com/topic/101119-check-for-special-characters/#findComment-517153 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.