this is one my badword function. I am using an array to store the bad word, but i know you can do it in text file with file($textfile);
but i don't know the format of how i store the badwords in text file
do i store it this way? same way as my array?
'fuck' => 'f', 'damn' => 'd', 'shit' => 's***'
function badword($message)
{
$badwords = array('fuck' => 'f***', 'damn' => 'd***', 'shit' => 's***');
foreach ($badwords as $badword => $censored)
{
$message = str_replace("$badword", "$censored", $message);
}
return $message;
}