Simple text filtering function of PHP

time:10-07-14 forum:PHP tools and code
  Function: filter the string (such as the title or content of the article) and prompt after the illegal words are encountered to prevent publication.
[code].lt;? Php
$obscenities = array (.Quot;.Quot;.Quot; membership.Quot;.Quot; offline.Quot;.Quot; landers; babies; babies; assistants;); / / / / / / / use file Save the word
foreach ($obscenities as $fuck_word) / / / / / / / >
{
if (stristr (trim ($title), $fuck_word)) After dropped, thank.Quot; / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /.Quot / / / / /
}

} / / traversal filter character ends
.Gt; [/code]

prev:Licheng small ad removal experience will... next:PHP removes the tail space and decimal p...
post comment
Notice



approved   North drift Female Boxers earn "bloo...   The only teacher in island primary s...   Mom and Dad took the baby on the pic...   People in Shandong have gone through...   The teacher was red for the student'...
rand   Generating HTML static pages with PH...   PHP reads the content of the MySQL d...   PHP time function date () solves the...   Using iconv to transform UTF-8 Chine...   The strftime () function converts mo...
ads

other

Because all the contents of this site are reproduced from other media, the intention is to provide free services to the public, but it does not mean that this site agrees with its views, and can not be responsible for the authenticity of its verification, such as the copyright unit or individual of the manuscript does not want to publish on this site, please Contact me, I will immediately remove it, thank you. Contact: atseashawk@163.com