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