fork(4) download
  1. <?php
  2.  
  3. function badWordsFilter($inputWord) {
  4. $badWords = Array("bad","words","here");
  5. for($i=0;$i<count($badWords);$i++) {
  6. if($badWords[$i] == strtolower($inputWord))
  7. return true;
  8. }
  9. return false;
  10. }
  11.  
  12. if (badWordsFilter("bad")) {
  13. echo "Bad word was found";
  14. } else {
  15. echo "No bad words detected";
  16. }
  17.  
  18. // your code goes here
Success #stdin #stdout 0.01s 20568KB
stdin
Standard input is empty
stdout
Bad word was found