0
我有以下代碼,我如何查詢壞詞和替換的數據庫,並使其工作。試圖查詢數據庫中的壞字列表。需要幫助與查詢
$ad_title2 = $ad_title;
$ad_body2 = $ad_body;
$wordlist = "sh%t:cr*p|dang:d*ng|shoot:sh**t";
$words = explode('|', $wordlist);
foreach ($words as $word) {
list($match, $replacement) = explode(':', $word);
$ad_title2 = preg_replace("/([^a-z^A-Z]?)($match)([^a-z^A-Z]?)/i", "$1".$replacement."$3", $ad_title2);
$ad_body2 = preg_replace("/([^a-z^A-Z]?)($match)([^a-z^A-Z]?)/i", "$1".$replacement."$3", $ad_body2);
}
這裏是我的表結構 表名是BADWORDS
我有3列
ID | word | r_word
任何幫助將不勝感激!
謝謝我會試一試! – 2011-03-11 12:04:50