Hello again, and sorry for the late response (I haven't worked on the forum for some time).
Your answers were great, and I was able to do this:
PHP Code:
if ($forum['forumid'] != 2)
{
$pat = array(
'f1',
'f2',
'f3',
'f4',
'f5',
'f6',
'f7',
'f8',
'f9',
'f10'
);
$rep = array(
'e1',
'e2',
'e3',
'e4',
'e5',
'e6',
'e7',
'e8',
'e9',
'e10'
);
foreach ($pat as &$value) {
$value = "/\b" . $value . "\b/iu" ;
}
$ret = preg_replace($pat, $rep, $this->post['message']);
if ($ret !== NULL)
$this->post['message'] = $ret;
}
And it worked fine. However, my forum is in portuguese, and when I change something to a word with any accentuation, like ? or ?, the code changes nothing at all (I guess ret == null).
I'm bypassing it by writing the words without accentuation.
Any thoughts?
Thanks!
EDIT: It doesn't work. Well, it worked for a while, but after two tests and two F5s, it stopped working. I can't understand why. And I was using this exact code, with this silly words.