<?php
error_reporting(-1);
function mb_strrev($string) {
return implode('', array_reverse(mb_split('/*/',$string)));
}
/* Коды для замены букв */
$code = array(
'а' => '1',
'б' => '2',
'в' => '3',
'г' => '4',
'д' => '5',
'е' => '6',
'ё' => '7',
'ж' => '8',
'з' => '9',
'и' => '0',
'й' => '#'
);
$text = 'нас предали. явка провалена.';
$cipher = strtr($text, $code);
$cipher = mb_strrev($cipher);
$deCypher = strtr ($cipher, array_flip($code));
$deCypher = mb_strrev($deCypher);
echo "Оригинал: {$text}\nШифровка: {$cipher}\n";
echo "Шифр дешиврованный: {$deCypher}";
PD9waHAKIAplcnJvcl9yZXBvcnRpbmcoLTEpOwoKZnVuY3Rpb24gbWJfc3RycmV2KCRzdHJpbmcpIHsKICAgIHJldHVybiBpbXBsb2RlKCcnLCBhcnJheV9yZXZlcnNlKG1iX3NwbGl0KCcvKi8nLCRzdHJpbmcpKSk7Cn0KIAovKiDQmtC+0LTRiyDQtNC70Y8g0LfQsNC80LXQvdGLINCx0YPQutCyICovCiRjb2RlID0gYXJyYXkoCiAgICAn0LAnCT0+CScxJywKICAgICfQsScJPT4JJzInLAogICAgJ9CyJwk9PgknMycsCiAgICAn0LMnCT0+CSc0JywKICAgICfQtCcJPT4JJzUnLAogICAgJ9C1Jwk9PgknNicsCiAgICAn0ZEnCT0+CSc3JywKICAgICfQticJPT4JJzgnLAogICAgJ9C3Jwk9PgknOScsCiAgICAn0LgnCT0+CScwJywKICAgICfQuScJPT4JJyMnCik7CiAKJHRleHQgPSAn0L3QsNGBINC/0YDQtdC00LDQu9C4LiDRj9Cy0LrQsCDQv9GA0L7QstCw0LvQtdC90LAuJzsKIAogCiRjaXBoZXIgPSBzdHJ0cigkdGV4dCwgJGNvZGUpOwokY2lwaGVyID0gbWJfc3RycmV2KCRjaXBoZXIpOwogCiRkZUN5cGhlciA9IHN0cnRyICgkY2lwaGVyLCBhcnJheV9mbGlwKCRjb2RlKSk7CiRkZUN5cGhlciA9IG1iX3N0cnJldigkZGVDeXBoZXIpOwogCiAKZWNobyAi0J7RgNC40LPQuNC90LDQuzogeyR0ZXh0fVxu0KjQuNGE0YDQvtCy0LrQsDogeyRjaXBoZXJ9XG4iOwplY2hvICLQqNC40YTRgCDQtNC10YjQuNCy0YDQvtCy0LDQvdC90YvQuTogeyRkZUN5cGhlcn0iOwoK
Main.java:1: error: class, interface, or enum expected
<?php
^
Main.java:1: error: class, interface, or enum expected
<?php
^
Main.java:1: error: class, interface, or enum expected
<?php
^
Main.java:5: error: class, interface, or enum expected
function mb_strrev($string) {
^
Main.java:6: error: empty character literal
return implode('', array_reverse(mb_split('/*/',$string)));
^
Main.java:6: error: unclosed character literal
return implode('', array_reverse(mb_split('/*/',$string)));
^
Main.java:6: error: unclosed character literal
return implode('', array_reverse(mb_split('/*/',$string)));
^
Main.java:6: error: unclosed character literal
return implode('', array_reverse(mb_split('/*/',$string)));
^
Main.java:7: error: class, interface, or enum expected
}
^
Main.java:24: error: class, interface, or enum expected
$text = '??? ???????. ???? ?????????.';
^
Main.java:24: error: unclosed character literal
$text = '??? ???????. ???? ?????????.';
^
Main.java:24: error: unclosed character literal
$text = '??? ???????. ???? ?????????.';
^
Main.java:28: error: class, interface, or enum expected
$cipher = mb_strrev($cipher);
^
Main.java:30: error: class, interface, or enum expected
$deCypher = strtr ($cipher, array_flip($code));
^
Main.java:31: error: class, interface, or enum expected
$deCypher = mb_strrev($deCypher);
^
Main.java:34: error: class, interface, or enum expected
echo "????????: {$text}\n????????: {$cipher}\n";
^
Main.java:35: error: class, interface, or enum expected
echo "???? ?????????????: {$deCypher}";
^
17 errors