count($textArr); $i++){ // jeder buchstabe des textes wird zum array, // in dessen ascii zeichen, $resAscii hinzugefügt array_push($textAscii, ord($textArr[$i])); // verschiebung $resAscii[$i] =+ $shift; // ascii buchstaben werden in ein wort gemacht array_push($resArr, chr($resAscii[$i])); } // aus array ein wort machen $result = implode("", $resArr); $yo = print_r($textArr); echo "
 $yo 
"; $yo = print_r($textAscii); echo "
 $yo 
"; $yo = print_r($resAscii); echo "
 $yo 
"; $yo = print_r($resArr); echo "
 $yo 
"; return $result; } // Formularverarbeitung $output = ""; $text = ""; $shift = 0; if ($_SERVER["REQUEST_METHOD"] === "POST") { $text = $_POST["text"] ?? ""; $shift = intval($_POST["shift"] ?? 0); if (isset($_POST["encrypt"])) { $output = caesar($text, $shift); } if (isset($_POST["decrypt"])) { $output = caesar($text, -$shift); } } ?> Caesar Chiffre

Caesar Chiffre