sandozlabz Posted July 17, 2008 Share Posted July 17, 2008 What expression do you use for preg_replace to remove "[" and "]" in a string, for example: The [boy] walked for 10 miles. so that it becomes: The boy walked for 10 miles. thanks in advance! Quote Link to comment Share on other sites More sharing options...
effigy Posted July 17, 2008 Share Posted July 17, 2008 Why not use str_replace? Any time you need to match a metacharacter, escape it. Quote Link to comment Share on other sites More sharing options...
sandozlabz Posted July 17, 2008 Author Share Posted July 17, 2008 ahhh!! i was making more complicated than it needed to be thanks! Quote Link to comment 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.