mraza Posted January 18, 2011 Share Posted January 18, 2011 hi i m trying to remove text between p and div tag but cant figure it out, plz any help. my text that i wants to remove from html: <p><strong>More:</strong></p> <p></p> <p> <br /> <br /> <br /> <br /> <br /> <br /> <br /> Test Text:more.text <br /> </p> <script src='/plus/ad_js' language='javascript'></script> <div class="relran"> <script src='file.js' language='javascript'></script> </div> i wants to remove all of this text from first line to end so tried this: $html = preg_replace("/<p><strong>More(.*?)+<\/div>/i", "", $html); but it does not work, plz any help? thanks Quote Link to comment https://forums.phpfreaks.com/topic/224831-replace-test-between-p-and-div/ Share on other sites More sharing options...
Psycho Posted January 18, 2011 Share Posted January 18, 2011 $html = preg_replace("/<p>.*?<\/div>/is", "", $html); Quote Link to comment https://forums.phpfreaks.com/topic/224831-replace-test-between-p-and-div/#findComment-1161612 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.