<?php
/* Коды для замены букв */
'а' => '1',
'б' => '2',
'в' => '3',
'г' => '4',
'д' => '5',
'е' => '6',
'ё' => '7',
'ж' => '8',
'з' => '9',
'и' => '0',
'й' => '#',
'к' => 'a',
'л' => 'b',
'м' => 'c',
'н' => 'd',
'о' => 'f',
'п' => 'l',
'р' => 'o',
'с' => 'e',
);
$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+CScwJywKICAgICfQuScJPT4JJyMnLAogICAgJ9C6Jwk9PgknYScsCiAgICAn0LsnCT0+CSdiJywKICAgICfQvCcJPT4JJ2MnLAogICAgJ9C9Jwk9PgknZCcsCiAgICAn0L4nCT0+CSdmJywKICAgICfQvycJPT4JJ2wnLAogICAgJ9GAJwk9PgknbycsCiAgICAn0YEnCT0+CSdlJywKKTsKCiR0ZXh0ID0gJ9C90LDQtNC+INGB0L/QsNGB0LDRgtGMINC40LfQttCwLic7CiRjaXBoZXIgPSBzdHJ0cigkdGV4dCwgJGNvZGUpOwoKZWNobyAi0KjQuNGE0YDQvtCy0LrQsDpcbtCe0YDQuNCz0LjQvdCw0Ls6IHskdGV4dH1cbtCo0LjRhNGA0L7QstC60LA6IHskY2lwaGVyfVxuIjsgIAoKCiR1bkNvZGUgPSBhcnJheV9mbGlwKCRjb2RlKTsKJHVuQ2lwaGVyID0gc3RydHIoJGNpcGhlciwgJHVuQ29kZSk7CgplY2hvICLQoNCw0YHRiNC40YTRgNC+0LLQutCwXG7QntGA0LjQs9C40L3QsNC7OiB7JGNpcGhlcn1cbtCg0LDRgdGI0LjRhNGA0L7QstC60LA6IHskdW5DaXBoZXJ9XG4iOw==