<?php
/* Коды для замены букв */
'а' => '1',
'б' => '2',
'в' => '3',
'г' => '4',
'д' => '5',
'е' => '6',
'ё' => '7',
'ж' => '8',
'з' => '9',
'и' => '0',
'й' => '#',
'к' => '48786',
'л' => '#565656',
'м' => '#апапа',
'н' => '098',
'о' => 'аппарпр',
'п' => '876765',
'р' => '2937358',
'с' => '79808',
);
$text = 'надо спасать изжа.';
$cipher = strtr($text, $code);
echo "Шифровка:\nОригинал: {$text}\nШифровка: {$cipher}\n";
$unCipher = strtr($cipher, $unCode);
echo "Расшифровка\nОригинал: {$cipher}\nРасшифровка: {$unCipher}\n";
PD9waHAKCmVycm9yX3JlcG9ydGluZygtMSk7CgovKiDQmtC+0LTRiyDQtNC70Y8g0LfQsNC80LXQvdGLINCx0YPQutCyICovCiRjb2RlID0gYXJyYXkoCiAgICAn0LAnCT0+CScxJywKICAgICfQsScJPT4JJzInLAogICAgJ9CyJwk9PgknMycsCiAgICAn0LMnCT0+CSc0JywKICAgICfQtCcJPT4JJzUnLAogICAgJ9C1Jwk9PgknNicsCiAgICAn0ZEnCT0+CSc3JywKICAgICfQticJPT4JJzgnLAogICAgJ9C3Jwk9PgknOScsCiAgICAn0LgnCT0+CScwJywKICAgICfQuScJPT4JJyMnLAogICAgJ9C6Jwk9PgknNDg3ODYnLAogICAgJ9C7Jwk9PgknIzU2NTY1NicsCiAgICAn0LwnCT0+CScj0LDQv9Cw0L/QsCcsCiAgICAn0L0nCT0+CScwOTgnLAogICAgJ9C+Jwk9Pgkn0LDQv9C/0LDRgNC/0YAnLAogICAgJ9C/Jwk9PgknODc2NzY1JywKICAgICfRgCcJPT4JJzI5MzczNTgnLAogICAgJ9GBJwk9PgknNzk4MDgnLAopOwoKJHRleHQgPSAn0L3QsNC00L4g0YHQv9Cw0YHQsNGC0Ywg0LjQt9C20LAuJzsKJGNpcGhlciA9IHN0cnRyKCR0ZXh0LCAkY29kZSk7CgplY2hvICLQqNC40YTRgNC+0LLQutCwOlxu0J7RgNC40LPQuNC90LDQuzogeyR0ZXh0fVxu0KjQuNGE0YDQvtCy0LrQsDogeyRjaXBoZXJ9XG4iOyAgCgoKJHVuQ29kZSA9IGFycmF5X2ZsaXAoJGNvZGUpOwokdW5DaXBoZXIgPSBzdHJ0cigkY2lwaGVyLCAkdW5Db2RlKTsKCmVjaG8gItCg0LDRgdGI0LjRhNGA0L7QstC60LBcbtCe0YDQuNCz0LjQvdCw0Ls6IHskY2lwaGVyfVxu0KDQsNGB0YjQuNGE0YDQvtCy0LrQsDogeyR1bkNpcGhlcn1cbiI7