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. Link to comment https://forums.phpfreaks.com/topic/8744-some-regex-help-please/ 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". Link to comment https://forums.phpfreaks.com/topic/8744-some-regex-help-please/#findComment-32209 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 :) Link to comment https://forums.phpfreaks.com/topic/8744-some-regex-help-please/#findComment-32304 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.