Ask a Question related to Macromedia Exchange Dreamweaver Extensions, Design and Development.
-
slp2008 #1
Abusive Language Filter
Where do I substitute words in the code to make it "work?" Peter Hawkes
submitted it March 2002 at [url]www.dwfaq.com/Snippets/[/url] Thanks in advance!:
<?php
$swear = array("abuse1", "abuse2", "abuse3", "abuse4", "abuse5", "abuse6");
$text="Hello you abuse1 abuse2 how are you, abuse3 abuse4 abuse5 abuse6";
echo "$text <br><br>";
foreach($swear as $key=> $value){
$text = str_replace("$value", "****", $text);
}
echo "$text";
?>
slp2008 Guest
-
Dictionary language switches language during spellcheck
During a spellcheck of a complete document, the language mysteriously switches from English USA (which in Canada isn't quite right, but that's... -
Language filter
Hi All I have a website with a standard html form on it. Every now and then some jerk submits the form with some dirty words. This is then seen... -
#25051 [Opn->WFx]: translating between gettext language identifiers and 'Accept-Language' ones
ID: 25051 Updated by: sniper@php.net Reported By: wouter at grep dot be -Status: Open +Status: Wont... -
#25051 [NEW]: translating between gettext language identifiers and 'Accept-Language' ones
From: wouter at grep dot be Operating system: irrelevant PHP version: Irrelevant PHP Bug Type: Feature/Change Request Bug... -
How to prevent the language icon from disappearing and a language switching delay?
What is wrong with my question since nobody answers it? How to improve the question? "Dmitriy Kopnichev" <kopn@hotbox.ru> wrote in message... -
Paul Davis #2
Re: Abusive Language Filter
you replace "abuse1", "abuse2", ... with your list of words and the
$text line with your line to strip out words, like:
$swear = array("cat","poo","dog","sex");
$text = $_POST['comments'];
or whatever field you're looking to filter instead of comments.
Paul Davis
[url]http://www.kaosweaver.com/[/url]
Visit us for dozens of useful Dreamweaver Extensions.
[url]http://www.communitymx.com/[/url]
Partner at Community MX - Extend your knowledge
slp2008 wrote:> Where do I substitute words in the code to make it "work?" Peter Hawkes
> submitted it March 2002 at [url]www.dwfaq.com/Snippets/[/url] Thanks in advance!:
>
> <?php
> $swear = array("abuse1", "abuse2", "abuse3", "abuse4", "abuse5", "abuse6");
> $text="Hello you abuse1 abuse2 how are you, abuse3 abuse4 abuse5 abuse6";
> echo "$text <br><br>";
> foreach($swear as $key=> $value){
> $text = str_replace("$value", "****", $text);
> }
> echo "$text";
> ?>
>Paul Davis Guest



Reply With Quote

