online punto switcher =))

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
$hash = 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'=>'ь',','=>'б','.'=>'ю','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'=>'Ь','<'=>'Б',
'>'=>'Ю');
$hash = array_merge ($hash, array_flip($hash));
function revert($word)
{
global $hash;
$newWord = '';
for($i = 0; $i < strlen($word); $i++)
{
$bukva = $word[$i];
foreach($hash as $buk1 => $buk2){
if($word[$i] == $buk1)
{
$bukva = $buk2;
break;
}
}
$newWord .= $bukva;
}
return $newWord;
}
if(isset($_FILES['list']['tmp_name']))
{
$file = file($_FILES['list']['tmp_name']);
$implode = array();
foreach ($file as $line)
{
$implode[] = '"'.trim($line).'";"'.revert(trim($line)).'"';
}
file_put_contents(dirname(__FILE__).'/reverter.csv', implode("\n", $implode));
print "<a href='reverter.csv'>file</a>";
}
?>
<form enctype="multipart/form-data" method="POST">
<input type="file" name="list">
<input type="submit">
</form>