I'm using this code to censor my message on my site:
Right now the word list are stored on a text file delimited with line breaks. I'm changing it to mysql. The words are stored in a mediumtext field also delimited by line breaks. My question is-- how can I change the code to getting the word list from mysql instead of the file?
Thank you.
-CALV1N
Code:
$fp = fopen("banned.txt","r");
while($word = fgets($fp,10000)) {
$str3 = ereg_replace(trim($word),"<censored>",$str3);
}
Right now the word list are stored on a text file delimited with line breaks. I'm changing it to mysql. The words are stored in a mediumtext field also delimited by line breaks. My question is-- how can I change the code to getting the word list from mysql instead of the file?
Thank you.
-CALV1N