我有一個包含受阻話功能如果字符串包含從數據庫中字
+--------+------------------+
| id | word |
+--------+------------------+
| 1 | this |
| 2 | word |
| 3 | is |
| 4 | blocked |
+--------+------------------+
我需要做的是,如果一個字符串包含阻塞寫檢查的功能列表的表字(表中的字)例如:
function blocked($string){
if(***blocked***){
return true;
}else{
return false;
}
}
函數應該返回true
不管這個詞本身就是一個字,或者如果它隱藏在另一個詞:
$string = "I want to see if this string is blocked"; //returns `true` because it contains 'this', 'is' and 'blocked'
$string = "iwanttoseeifthisstringisblocked"; //returns `true`
希望我的問題是清楚的,
任何幫助表示讚賞
構建從表或谷歌博耶 - 穆爾一個高性能正則表達式 – sehe