Guest User

Untitled

a guest
Oct 20th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. function munge($input) {
  2.  
  3. $input = strtolower($input);
  4.  
  5. if(preg_match_all('/([a-zA-Z])\1{1,}/i', $input, $matches))
  6. {
  7. foreach($matches[1] as $key => $char)
  8. {
  9. $input = str_replace($matches[0][$key], strlen($matches[0][$key]) . $char, $input);
  10. }
  11. }
  12.  
  13. $search = ['a','b','c','d','e','f','g','h','i','i','k','l','l','o','q','s','s','t','v','v','w','w','x','y',];
  14. $replace = ['@','8','(','6','3','#','9','#','1','!','<','1','i','0','9','5','$','+','>','<','uu','2u','%','?',];
  15.  
  16. foreach($search as $k => $s)
  17. {
  18. $pos = strpos($input, $s);
  19.  
  20. if(false !== $pos)
  21. {
  22. $input = substr_replace($input, $replace[$k], $pos, 1);
  23. }
  24. }
  25.  
  26. return $input;
  27. }
Add Comment
Please, Sign In to add comment