Sylvester21
03-14-2007, 09:05 AM
Hey peepz,
I've got a small problem with the following:
$bbcode = array(
"'\[code\](.*?)\[/code\]'"
$html = array(
"<div class=\"codetop\">CODE</div><div class=\"codemain\"><br /><br />\\1<br /><br /></div></div>"
I've left all other BBcode out and smiley stuff, and other PHP code. I'm using the above (using code example from IPB forums) to replace [*code] with <div class= etc. It works, when the actual [*code] is on one line. If I have more text in the code, it doesn't work, example:
[*code]Blabla here [*/code]
The above works fine. But when it has more text like below:
[*code]Blabla here
And some more blabla here
And then another bla here,
Last but not least, one more bla[*/code]
It doesn't work. Any idea how this can be resolved?
I've got a small problem with the following:
$bbcode = array(
"'\[code\](.*?)\[/code\]'"
$html = array(
"<div class=\"codetop\">CODE</div><div class=\"codemain\"><br /><br />\\1<br /><br /></div></div>"
I've left all other BBcode out and smiley stuff, and other PHP code. I'm using the above (using code example from IPB forums) to replace [*code] with <div class= etc. It works, when the actual [*code] is on one line. If I have more text in the code, it doesn't work, example:
[*code]Blabla here [*/code]
The above works fine. But when it has more text like below:
[*code]Blabla here
And some more blabla here
And then another bla here,
Last but not least, one more bla[*/code]
It doesn't work. Any idea how this can be resolved?