Created
December 25, 2018 03:21
-
-
Save imdong/ca6b9f45725d6865b9e5677a97acdc73 to your computer and use it in GitHub Desktop.
UCloud-云计算总动员《极客侦探互动解密:第一期》解题 Demo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$str = "Uhg fkxufk"; | |
$arr = str_split($str, 1); | |
for ($i=0; $i < 25; $i++) { | |
foreach ($arr as $item) { | |
$val = ord($item); | |
// 空格跳过 | |
$new = $val; | |
if ($val != 32) { | |
// 区分大小写 加偏移 | |
$new = $val + $i; | |
if ($new > (($val > 90) ? 122 : 90)) { | |
$new -= 26; | |
} | |
} | |
echo chr($new); | |
} | |
echo "\n"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment