PDA

View Full Version : The PHP tag strips out preg replace...


Zzed
04-13-2003, 07:32 PM
This code:


$text = preg_replace("/Hello/i", "Hi there", $text");


Ends up looking like this:

$text = preg_replace("/Hello/i", "Hi there", $text");


I noticed this a couple days ago.

Thank you in advance. :)

Zzed
04-13-2003, 07:33 PM
That's odd... :confused:

Look at this post: https://vborg.vbsupport.ru/showthread.php?postid=379164#post379164

Zzed
04-13-2003, 07:34 PM
Here it is...

if($newthread) {
$text = preg_replace("/IMG/i", "", $text);
$text = preg_replace("/img/i", "", $text);
}

filburt1
04-13-2003, 07:59 PM
Looks fine to me, except it's not color-coding it.

Zzed
04-13-2003, 08:20 PM
I am using the Purple style.

This is what the contents of post #3 look like:

if($newthread) {
$text = "/IMG/i", "", $text);
$text = "/img/i", "", $text);
}

Dean C
04-14-2003, 09:20 AM
I saw it stripping a double quote in your first post *confused* :)

Xenon
04-14-2003, 03:39 PM
hmm, i don't see anything wrong here, but nevertheless i remember the devs working on a solution and also had some problems...