How to make a list of forbidden words, only if it comes with stuck symbols.
-
I have a list of values ??that are denied in a function, but the code is too big, I would like you to help me make a higher quality code:
$Search = array ('string1', 'string2', 'string3', 'string4', 'string5'); Here a function that denies them, okay it works and I get what I want ...
buuuut
These strings t1 t2 t3 can not be denied, and these special symbols like: can not be denied either, so I can not write them alone in my Function in the $search variable, if not when one of these strings is needed, it will be denied and this can not happen, but together they should be denied:
$Search = array ('}t1', ')t1', ';t1', '%t1', '*t1', .... many values ?? .... '-t2', '=t2', ')T2', '*t2', '!T2', '@t2', '#t2', '%t2' ... many values ??... '.t3','@t3',';t3','%T3',' *t3','~t3 ', ... muuuitooos .....);
well.. is working, I put all kinds of possible formations, and so my code is very giant!
I would like an idea something like this:
$Rejected_symbols_with_some_words = array ('*', '#', '-', '!', '?', '+', '=', '¨', '^', '~', '@',';','.','_',':','{',']','[','}','′','?','¢'....); $Wordtosimbols = array ('t1', 't2', 't3','t4','t5','t6'); $Wordsandsymb. = $Rejected_symbols_with_some_words + $wordtosimbols; $Search = array($wordsandsymb, 'string1', '+string2', '@string3', '-string4', '&string5');
I tried with implode:
$Rejected_symbols = array('*','#','-','!','?','+','=','¨','^','~','@'); $wordsandsimbols = implode('t1','t2','t3', $Rejected_symbols); $search = array($wordsandsimbols,'string1','string2','string3','string4');
The code works only for array strings.. ‘string1′,’string2′,’string3′,’string4’ ..
Does not work with variable values $wordsandsimbols This would drastically reduce my file. But it does not work, I know it’s wrong, but I do not know how to do it right. It’s just an idea, thanks.
—
In short: all the symbols will be forbidden, (this I am already ready) some words also prohibited, (this already is working also)
Buuuut they lack a condition to forbid some words if they come against prohibited symbols, but they alone pass.
- The topic ‘How to make a list of forbidden words, only if it comes with stuck symbols.’ is closed to new replies.