Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function munge($input) {
- $input = strtolower($input);
- if(preg_match_all('/([a-zA-Z])\1{1,}/i', $input, $matches))
- {
- foreach($matches[1] as $key => $char)
- {
- $input = str_replace($matches[0][$key], strlen($matches[0][$key]) . $char, $input);
- }
- }
- $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',];
- $replace = ['@','8','(','6','3','#','9','#','1','!','<','1','i','0','9','5','$','+','>','<','uu','2u','%','?',];
- foreach($search as $k => $s)
- {
- $pos = strpos($input, $s);
- if(false !== $pos)
- {
- $input = substr_replace($input, $replace[$k], $pos, 1);
- }
- }
- return $input;
- }
Add Comment
Please, Sign In to add comment