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 ? 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 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 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
Archived
This topic is now archived and is closed to further replies.