Advertisement
Guest User

Untitled

a guest
Apr 18th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. <?php ////////////////////////////////////////////////////////////////////////////
  2. //////////////////////////////////////////////////////////////////////////////////
  3. function TestReg($text) {
  4.  
  5. $on = array('q','w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', 'a', 's',
  6. 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'z', 'x', 'c', 'v', 'b', 'n', 'm');
  7. $ap = array('Q','W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', 'A', 'S',
  8. 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'Z', 'X', 'C', 'V', 'B', 'N', 'M');
  9. $array = str_split($text);
  10. foreach ($array as $value) {
  11. foreach ($on as $key => $value2) {
  12.  
  13. if ($value === $on[$key]) {
  14. $res = str_replace($on, $ap, $value);
  15. }
  16.  
  17. if ($value === $ap[$key]) {
  18. $res = str_replace($ap, $on, $value);
  19. }
  20. }
  21. $result .= $res;
  22. }
  23. return $result;
  24. }
  25. echo '<h1>'.TestReg("ASDsSSSdasDasdasd").'</h1>';
  26. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement