Guest upirate Posted April 8, 2007 Share Posted April 8, 2007 preg_replace("/[^a-zA-Z0-9s]/", " ", $text); I wish to allow the user to enter a space and the "-" character what should I do ? Quote Link to comment https://forums.phpfreaks.com/topic/46155-solved-need-simple-help-with-preg_replace/ Share on other sites More sharing options...
wildteen88 Posted April 8, 2007 Share Posted April 8, 2007 Use this as the pattern: /[^a-z0-9\-\s]/i Quote Link to comment https://forums.phpfreaks.com/topic/46155-solved-need-simple-help-with-preg_replace/#findComment-224343 Share on other sites More sharing options...
Guest upirate Posted April 8, 2007 Share Posted April 8, 2007 thankyou Quote Link to comment https://forums.phpfreaks.com/topic/46155-solved-need-simple-help-with-preg_replace/#findComment-224367 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.