Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php ////////////////////////////////////////////////////////////////////////////
- //////////////////////////////////////////////////////////////////////////////////
- function TestReg($text) {
- $on = array('q','w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', 'a', 's',
- 'd', 'f', 'g', 'h', 'j', 'k', 'l', 'z', 'x', 'c', 'v', 'b', 'n', 'm');
- $ap = array('Q','W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', 'A', 'S',
- 'D', 'F', 'G', 'H', 'J', 'K', 'L', 'Z', 'X', 'C', 'V', 'B', 'N', 'M');
- $array = str_split($text);
- foreach ($array as $value) {
- foreach ($on as $key => $value2) {
- if ($value === $on[$key]) {
- $res = str_replace($on, $ap, $value);
- }
- if ($value === $ap[$key]) {
- $res = str_replace($ap, $on, $value);
- }
- }
- $result .= $res;
- }
- return $result;
- }
- echo '<h1>'.TestReg("ASDsSSSdasDasdasd").'</h1>';
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement