Guernica Posted December 4, 2008 Share Posted December 4, 2008 I have a code that uses preg_replace to create bbcode from the form submitted. Within the preg_replace is this: '/\[quote\](.*?)\[\/quote\]/is', '/\[quote\=(.*?)\](.*?)\[\/quote\]/is', This only works for one instance of the quote tag. I tried submitting something like [*quote=user1] lala [*quote=user2]ooo[/*quote][/*quote]. It only tags the first instance, how do I do this for multiple ones? Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/135565-preg_replace-with-quoting/ Share on other sites More sharing options...
.josh Posted December 4, 2008 Share Posted December 4, 2008 post an example of what the string looks like and what you want it to look like. Quote Link to comment https://forums.phpfreaks.com/topic/135565-preg_replace-with-quoting/#findComment-706240 Share on other sites More sharing options...
Guernica Posted December 10, 2008 Author Share Posted December 10, 2008 Well, it's like I said above. Take the [/quote*] tags and convert them to whatever. Like I have in the preg_replace in my first post. Just taking them and making it like <div id="quoted_msg">Posted by: $1<br/>$2</div> Quote Link to comment https://forums.phpfreaks.com/topic/135565-preg_replace-with-quoting/#findComment-711105 Share on other sites More sharing options...
Guernica Posted December 22, 2008 Author Share Posted December 22, 2008 Anyone know how to make this work? Quote Link to comment https://forums.phpfreaks.com/topic/135565-preg_replace-with-quoting/#findComment-721537 Share on other sites More sharing options...
effigy Posted December 22, 2008 Share Posted December 22, 2008 Try this. Quote Link to comment https://forums.phpfreaks.com/topic/135565-preg_replace-with-quoting/#findComment-721605 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.