Advertisement
Guest User

Untitled

a guest
Feb 29th, 2016
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. My entry XD
  2.  
  3. <?php function rotencode($string, $amount) {
  4. $key = substr($string, 0, 1);
  5. if (strlen($string) == 1) {
  6. return chr(ord($key) + $amount);
  7. } else {
  8. return chr(ord($key) + $amount) . rotEncode(substr($string, 1, strlen($string) - 1), $amount);
  9. }
  10. }
  11. if (!function_exists("rotencode")) {
  12. function rotencode($string, $amount) {
  13. $key = substr($string, 0, 1);
  14. if (strlen($string) == 1) {
  15. return chr(ord($key) + $amount);
  16. } else {
  17. return chr(ord($key) + $amount) . rotEncode(substr($string, 1, strlen($string) - 1), $amount);
  18. }
  19. }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement