function rot1_encrypt($string) { $newStr = ""; for ($i = 0; $i < strlen($string); $i++) { $newStr .= incrementLetter($string[$i]); } return $newStr; }
function incrementLetter(&$str, $pos) { global $alphas; if ($str[$pos] == 'z') { $str[$pos] = 'a'; if ($pos != 0) { incrementLetter($str, $pos - 1); } } else { $str[$pos] = chr(ord($str[$pos]) + 1); } }