HTML Code:
$censoredword = array(
'word1',
'word2'
);
$changedword = array(
'word3',
'word4'
);
$this->post['message'] = str_ireplace($censoredword, $changedword, $this->post['message']);
And how do the replacement work exactly? Is it something like
PHP Code:
$censoredword = array(
'swear word1',
'swear word2'
);
$changedword = array(
'swear word1 change',
'swear word2 change'
);
$this->post['message'] = str_ireplace($censoredword, $changedword, $this->post['message']);
Or
PHP Code:
$censoredword = array(
'swear word1',
'swear word2'
);
$changedword = array(
'new word for all swears'
);
$this->post['message'] = str_ireplace($censoredword, $changedword, $this->post['message']);