Brandon Jaeger Posted April 30, 2006 Share Posted April 30, 2006 Hi, I need to replace anything between <div> tags with nothing ( "" ). What's the regex pattern for this?Thanks in advance. Quote Link to comment Share on other sites More sharing options...
toplay Posted April 30, 2006 Share Posted April 30, 2006 Use something like this:$text = preg_replace('/<div>.*?<\/div>/si', '<div></div>', $text);or this:$text = preg_replace('/<div>.*?<\/div>/si', '', $text);depending on what you mean by "nothing". Quote Link to comment Share on other sites More sharing options...
Brandon Jaeger Posted May 1, 2006 Author Share Posted May 1, 2006 I meant "nothing" as in a blank string.Thank you :) 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.