paulonline2501 Posted August 7, 2013 Share Posted August 7, 2013 hi, i have a preg_match that checks "descriptions". the preg_match fails when i input an apostrophe ' in the text box. my code is as follows: $clean_description_step01 = htmlentities($thisValue, ENT_QUOTES);$clean_description_step02 = stripslashes($clean_description_step01); if(preg_match("/^[-',.a-z0-9dws]{1,200}$/i",$clean_description_step02)) { do something here...} can any one see why its not working? Link to comment Share on other sites More sharing options...
HungryMind Posted August 7, 2013 Share Posted August 7, 2013 Try to remove ^ from start and $ from end and then test code again. Link to comment Share on other sites More sharing options...
paulonline2501 Posted August 9, 2013 Author Share Posted August 9, 2013 (edited) well, that seemed to work. tnxs Edited August 9, 2013 by as_bold_as_love Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now