johnsmith153 Posted September 17, 2009 Share Posted September 17, 2009 I want to allow all letters and the & character $allowed = "/[^a-z\\040]/i"; I am sure I need a slight change to the above line of code. Quote Link to comment https://forums.phpfreaks.com/topic/174621-allowed-a-z040i-how-also-allow-sign/ Share on other sites More sharing options...
nrg_alpha Posted September 17, 2009 Share Posted September 17, 2009 You start your character class with ^, which negates the entire class.. If you want to allow only letters and the ampersand character, then perhaps something along the lines of: $allowed= '#^[a-z\x26]+$#i'; Quote Link to comment https://forums.phpfreaks.com/topic/174621-allowed-a-z040i-how-also-allow-sign/#findComment-920421 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.