Hi I got a serious trouble at turning my eregi code into preg match.
My site has introduced a censorshop on the use of some words. It was implemented by eregi. However, recently my server has been upgraded to php 5.3 and the code doesn't work anymore.
While I've successfully replaced eregi_replace with preg_replace, this eregi syntax doesn't seem to work, possibly due to the use of Trim() in the code.
Please teach me what i should do. Thanks a lot.
$fh = fopen("bannedword.txt","r");
while($word = fgets($fh)) {
if (eregi(trim($word), $output))
{
echo "Sorry. Nothing shows.";
exit;
}
}