PDA

View Full Version : how to make word censor


Thug
08-21-2005, 08:27 PM
Hi im doing a script www.oh-twadi.com/ratedesi1 and im curious to no how i would go about creating a word censorship on it
so i can blank words of my choice

Marco van Herwaarden
08-22-2005, 10:20 AM
You can use str_replace()

Thug
08-25-2005, 03:15 PM
can you tell me more abit it please
i wish to try it

Andreas
08-25-2005, 03:29 PM
$censored = str_replace(array('fuck', 'shit'), '*** Censored ***', 'This Text contains foul language');

Thug
08-25-2005, 03:42 PM
ok i got http://www.oh-twadi.com/censor.php
that working using

<?php

$badWords = array('Note', 'bush');

function replacebadwords($string,$badword_array) {
foreach ($badword_array as $v) {
$newstring = "";
for($i = 0; $i < strlen($v); $i++) {
$newstring .= "*";
}
$string = str_replace($v,$newstring,$string);
}

return $string;
}

$text = "Note mom is george bush's grandma.";

$text = replacebadwords($text,$badWords);

echo $text;

?>



But how do i get it to work on www.oh-twadi.com page

Marco van Herwaarden
08-25-2005, 03:56 PM
@Thug,

Is it really needed that you put your URL 1 or more times in EVERY post you make?

Just a personal note, but i am getting a bit sick from it, and i plan to remove all unneeded links to your site if you continue.

Thug
08-25-2005, 04:02 PM
doesnt make a diff
cause if u search oh-twadi on google vbulletin cums up so realy it gets more hits to u

Marco van Herwaarden
08-25-2005, 08:42 PM
Well i don't care about what happens when i google for twidle-didle-doo, i just care about you spamming this board with your url. Sorry for putting it that blunt, but you seem not to understand if i put it in another way.

PS Maybe i am just tired, and not up to write it down in a more diplomatic way.

Thug
08-25-2005, 10:32 PM
tiddle dum lol it meens yours .com asians seem to be creative
i aint goin toargue cause then i wud stoop as low as you
all i want is to no how to add the censorship on a non vb page

sabret00the
08-25-2005, 10:44 PM
twidle-didle-doo
LMAO