That above $comment should be
$comment = 'Testing.
<P>[PRE]<FONT FACE="Courier">1 2 3
<P>4 5 6
<P>7 8 9
<P>10 11 12</FONT>[/PRE]
<P>This is your test.';
I want $comment to be:
"Testing.
<P><PRE><FONT FACE="Courier">1 2 3
4 5 6
7 8 9
10 11 12</FONT></PRE>
<P>This is your test."
I've modified my snippet and I've gotten it to remove one of the <P> in-betweeen the [PRE][/PRE] tags(the last one), but not all occurrences. Here it is:
echo preg_replace ("/[PRE]([\[])(<P>([\[]))[\/PRE]/", '<PRE>'.'\1'.'\3'.'</PRE>', $comment);
This returns:
"Testing.
<P><PRE><FONT FACE="Courier">1 2 3
<P>4 5 6
<P>7 8 9
10 11 12</FONT></PRE>
<P>This is your test."