iwpg Posted March 8, 2010 Share Posted March 8, 2010 Hi, I am trying to do something similar to the post at: http://www.phpfreaks.com/forums/index.php/topic,283988.msg1346588.html#msg1346588 but so far I have not had luck. I have a database filled with forum replies that some have quoted text that I want removed, and just show the response. In this case, "You're welcome!" should only be shown. This is what I have so far, but it does nothing: Example: $pagetext = "[quote=hd331;23548]That makes a lot of sense. Thanks.[/quote] You're welcome!"; $newpagetext = preg_replace('/\[quote=(.*?)\](.*?)\[\/QUOTE\]/i',' ',$pagetext); Quote Link to comment https://forums.phpfreaks.com/topic/194564-preg_replace-help/ Share on other sites More sharing options...
iwpg Posted March 9, 2010 Author Share Posted March 9, 2010 Please help??? Quote Link to comment https://forums.phpfreaks.com/topic/194564-preg_replace-help/#findComment-1023790 Share on other sites More sharing options...
nafetski Posted March 9, 2010 Share Posted March 9, 2010 What you have works fine! You just need...(and if this is it, you will prob smack yourself in the head) echo $newpagetext; Quote Link to comment https://forums.phpfreaks.com/topic/194564-preg_replace-help/#findComment-1023901 Share on other sites More sharing options...
iwpg Posted March 10, 2010 Author Share Posted March 10, 2010 I added a substr_replace right before that to limit the amount of text shown, and it cut of the end QUOTE tag. Thanks for straightening me up! Quote Link to comment https://forums.phpfreaks.com/topic/194564-preg_replace-help/#findComment-1024095 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.