Advertisement
vir0e5

php CLI ROT13 Caesar Cipher

Mar 5th, 2013 (edited)
103
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. function rot13($s) {return !$s?"":strtr($s,"NnOoPpQqRrSsTtUuVvWwXxYyZzAaBbCcDdEeFfGgHhIiJjKkLlMm",
  3. "AaBbCcDdEeFfGgHhIiJjKkLlMmNnOoPpQqRrSsTtUuVvWwXxYyZz");}
  4. echo "ROT13 Caesar Cipher, Created by vir0e5\n";
  5. echo "===================================\n";
  6. fwrite(STDOUT, "Input Plain Text  =  ");
  7. $string = fgets(STDIN);
  8. $rot = rot13($string);
  9. echo "Result = $rot ";
  10. ?>
Advertisement
RAW Paste Data Copied
Advertisement