<?php
(
'а' => '1',
'б' => '2',
'в' => '3',
'г' => '4',
'д' => '5',
'е' => '6',
'ё' => '7',
'ж' => '8',
'з' => '9',
'и' => '!',
'й' => '@',
'к' => '#',
'л' => '$',
'м' => '%',
'н' => '^',
'о' => '&',
'п' => '*',
'р' => '(',
'с' => ')',
'т' => '_',
'у' => '+',
'ф' => '-',
'х' => '=',
'ц' => '"',
'ч' => '№',
'ш' => ';',
'щ' => ':',
'ь' => '?',
'ы' => '{',
'ъ' => '}',
'э' => '<',
'ю' => '>',
'я' => '.'
);
$text = 'чё кого';
$cipher = strtr($text, $code);//шифруем текст echo "Оригинал:{$text}\nШифровка:{$cipher}\n";
$flipCode = array_flip($code);//меняем ключи и значения в массиве $flipCipher = strtr($cipher, $flipCode);//расшифровываем текст echo "Шифровка:{$cipher}\nРасшифровка:{$flipCipher}";
PD9waHAKCmVycm9yX3JlcG9ydGluZygtMSk7CiRjb2RlID0gYXJyYXkKCSgKCSfQsCcgPT4gJzEnLAoJJ9CxJyA9PiAnMicsCgkn0LInID0+ICczJywKCSfQsycgPT4gJzQnLAoJJ9C0JyA9PiAnNScsCgkn0LUnID0+ICc2JywKCSfRkScgPT4gJzcnLAoJJ9C2JyA9PiAnOCcsCgkn0LcnID0+ICc5JywKCSfQuCcgPT4gJyEnLAoJJ9C5JyA9PiAnQCcsCgkn0LonID0+ICcjJywKCSfQuycgPT4gJyQnLAoJJ9C8JyA9PiAnJScsCgkn0L0nID0+ICdeJywKCSfQvicgPT4gJyYnLAoJJ9C/JyA9PiAnKicsCgkn0YAnID0+ICcoJywKCSfRgScgPT4gJyknLAoJJ9GCJyA9PiAnXycsCgkn0YMnID0+ICcrJywKCSfRhCcgPT4gJy0nLAoJJ9GFJyA9PiAnPScsCgkn0YYnID0+ICciJywKCSfRhycgPT4gJ+KElicsCgkn0YgnID0+ICc7JywKCSfRiScgPT4gJzonLAoJJ9GMJyA9PiAnPycsCgkn0YsnID0+ICd7JywKCSfRiicgPT4gJ30nLAoJJ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