Hi I have a problem with this code. The problem is that it only redirect when I ONLY write "word" in the text field. I want it to redirect whenever "word" is submitted even if there is other characters in the textfield. Is there any code that tells it that it will trigger whenever it finds that array in the text field? function wordsExist(&$string, $words) { foreach($words as &$word) { if(stripos($string, $word) !== false) { return true; } } return false; } if (wordsExist($search, array('word'))) { $redir = $search; } PHP: Thanks in advance
function wordsExist ($string, $words) { foreach ($words as $word) { if (strpos($string, $word) == true) { return true; } else { continue; } } if (wordsExist($search, array('word'))) { $redir = $search; } PHP:
MyVodaFone: in_array didnt work... The thing is that it works perfectly when I type "word".. But if I type "word word2" then it doesnt .. I want it to work when it detects "word" even if there is other words as well .. Artifactial Connection: Left me with a blank page