gazever Posted September 17, 2007 Share Posted September 17, 2007 Hi I know this will seem really simple, How do I validate a string for only characters a-z A-Z and 0-9, I have tried lots of different eregi, but cant get the syntax right, Thanks Gaz Link to comment https://forums.phpfreaks.com/topic/69692-simple-question/ Share on other sites More sharing options...
marcus Posted September 17, 2007 Share Posted September 17, 2007 For just alphanumeric keys use ctype_alnum() Link to comment https://forums.phpfreaks.com/topic/69692-simple-question/#findComment-350159 Share on other sites More sharing options...
gazever Posted September 17, 2007 Author Share Posted September 17, 2007 fantastic thanks Link to comment https://forums.phpfreaks.com/topic/69692-simple-question/#findComment-350162 Share on other sites More sharing options...
cooldude832 Posted September 17, 2007 Share Posted September 17, 2007 A more generic solution is to use regex to verify that the string follows the proper pattern of characters and number. There is a regex forum here and lots of good tutorials out there to learn it. The function is preg() Link to comment https://forums.phpfreaks.com/topic/69692-simple-question/#findComment-350164 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.