Hi all,
I’m trying to replace the following:
[code=php]$tr=array(“<“,”>”,”n”,”[b]”,”[/b]”,”[i]”,”[/i]”,”[u]”,”[/u]”,”javascript”,”[red]”,”[/red]”,”[blue]”,”[/blue]”,”[yellow]”,”[/yellow]”,”[green]”,”[/green]”,”[black]”,”[/black]”,”[white]”,”[/white]”,”[sub]”,”[/sub]”,”[sup]”,”[/sup]”,”[move]”,”[/move]”,”[s]”,”[/s]”,”\””,”‘”,”****”,”bloody”,”****”,”****”);
$tr2=array(“<”,”>”,”<br />”,”<b>”,”</b>”,”<i>”,”</i>”,”<u>”,”</u>”,”java script”,”<font style=”color:red”>”,”</font>”,”<font style=”color:blue”>”,”</font>”,”<font style=”color:yellow”>”,”</font>”,”<font style=”color:green”>”,”</font>”,”<font style=”color:black”>”,”</font>”,”<font style=”color:white”>”,”</font>”,”<sub>”,”</sub>”,”<sup>”,”</sup>”,”<marquee>”,”</marquee>”,”<s>”,”</s>”,”"”,”‘”,”****”,”******”,”****”,”****”);
$_POST[‘message’]=str_ireplace($tr,$tr2,$_POST[‘message’]);
With a preg_replace function.
Line 32 to 35 are what I have replaced the str_ireplace function with:
[code=php]for($trar=0;$trar<count($tr);$trar++){
$tr[$trar]=”/”.$tr[$trar].”/i”;
}
$_POST[‘message’]=preg_replace($tr,$tr2,$_POST[‘message’]);
But it doesn’t replace it.
File is attached.
Thanks,
Neil
[upl-file uuid=6968e6f3-01dd-4c72-b764-20c198544c3b size=5kB]shout2.txt