Skip to content

Instantly share code, notes, and snippets.

@imdong
Created December 25, 2018 03:21
Show Gist options
  • Save imdong/ca6b9f45725d6865b9e5677a97acdc73 to your computer and use it in GitHub Desktop.
Save imdong/ca6b9f45725d6865b9e5677a97acdc73 to your computer and use it in GitHub Desktop.
UCloud-云计算总动员《极客侦探互动解密:第一期》解题 Demo
<?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