$char) { $newchar = ((ord($char) + ord($key[$i % strlen($key)])) - 96*2) % 27 + 96; $newtext .= chr($newchar); } } else if ($_POST["type"] == "Decode") { foreach ($chars as $i => $char) { $newchar = (ord($char) - ord($key[$i % strlen($key)]) + 27) % 27 + 96; $newtext .= chr($newchar); } } echo str_replace("`", " ", $newtext); ?>
Text:

Key: