The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Help with preg_replace
Hi.
I'm a completely noob when it comes to regexp, so I guess I can post here for a little help I need to replace all the <br /> on a variable to simple line breaks (\n). The problem is that I need to replace the <br />'s that are ONLY inside a special tag, for example, the <myhtml> and </myhtml> tags. See: Code:
<html> <head><title></title> </head> <body> . . . <myhtml> Here is some text<br /> and some more text<br /> Bye. </myhtml> . . . </body></html> Is that possible? Please help!! |
#2
|
|||
|
|||
PHP Code:
|
#3
|
||||
|
||||
How would you do that with vbcode tags like the php tags?
|
#4
|
||||
|
||||
Hi filburt1. Thanks for your code, but it doesn't work as it should
It replaces absolutely all the <br />'s on the variable... But I only need to replace the <br />'s that are inside the <myhtml> and </myhtml> tags. For example: This: Code:
<html> <head><title></title> </head> <body> . . Text out side<br /> of the myhtml tags<br /> . <myhtml> Here is some text<br /> and some more text<br /> Bye. </myhtml> . . . </body></html> Code:
<html> <head><title></title> </head> <body> . . Text out side<br /> of the myhtml tags<br /> . <myhtml> Here is some text\n and some more text\n Bye. </myhtml> . . . </body></html> If you could help me with that one, I will thank you my whole life ! |
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|