01.
function
chkWordProfanity(
$word
){
02.
@
$FileNewsTopic
=
"../document/profanity.txt"
;
03.
@
$file_open
= @
fopen
(@
$FileNewsTopic
,
"r"
);
04.
@
$TextContent
= @
fread
(@
$file_open
, @
filesize
(@
$FileNewsTopic
));
05.
@fclose (@
$file_open
);
06.
@
$TextContent
=
stripslashes
(@
$TextContent
);
07.
$exWord
=
explode
(
","
,
$TextContent
);
08.
foreach
(
$exWord
as
$k
=>
$v
){
09.
10.
}
11.
12.
for
(
$i
=0;
$i
<
count
(
$exWord
);
$i
++){
13.
$word
=
eregi_replace
(
$exWord
[
$i
],
'<span style="background:#F00; color:#fff;">'
.
$exWord
[
$i
].
'</span>'
,
$word
);
14.
}
15.
return
$word
;
16.
17.
}