fork download
  1. <?php
  2. $bacon=array('a'=>'AAAAA', 'b'=>'AAAAB', 'c'=>'AAABA', 'd'=>'AAABB', 'e'=>'AABAA', 'f'=>'AABAB');
  3. $word="the jOs to kIll fAr";
  4.  
  5. $word=str_replace(" ","",$word);
  6. $word=preg_replace("![A-Z]!", "B", $word);
  7. $word=preg_replace("![a-z]!", "A", $word);
  8. $word = preg_split("//u", $word, null, PREG_SPLIT_NO_EMPTY);
  9. $word=array_chunk($word,5);
  10. for($i=0; $i<count($word); $i++) {
  11. $letters.=implode($word[$i])." ";
  12. }
  13. $bacon1=array_flip($bacon);
  14. $letters=str_replace($bacon,$bacon1,$letters);
  15. $letters=str_replace(" ","",$letters);
  16.  
  17. echo $letters;
  18.  
Success #stdin #stdout #stderr 0.02s 24448KB
stdin
Standard input is empty
stdout
bbc
stderr
PHP Notice:  Undefined variable: letters in /home/943fUS/prog.php on line 11