rename file
This commit is contained in:
parent
17f79f777d
commit
6318f3e89b
2 changed files with 1 additions and 1 deletions
22
demo/fortgeschritten/loesung.php
Normal file
22
demo/fortgeschritten/loesung.php
Normal file
|
@ -0,0 +1,22 @@
|
|||
<?php
|
||||
|
||||
$antwort1 = $_POST['frage-1'];
|
||||
$antwort2 = $_POST['frage-2'];
|
||||
$antwort3 = $_POST['frage-3'];
|
||||
|
||||
function zeigeErgebnis(string $gegebeneAntwort, string $richtigeAntwort): void
|
||||
{
|
||||
if ($gegebeneAntwort === $richtigeAntwort) {
|
||||
echo 'richtig';
|
||||
} else {
|
||||
echo "falsch ($richtigeAntwort)";
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
<h2>Antwort 1 ist <?php zeigeErgebnis($antwort1, 'Hund') ?>
|
||||
</h2>
|
||||
<h2>Antwort 2 ist <?php zeigeErgebnis($antwort2, 'Blau'); ?>
|
||||
</h2>
|
||||
<h2>Antwort 3 ist <?php zeigeErgebnis($antwort3, 'Banane'); ?>
|
||||
</h2>
|
Loading…
Add table
Add a link
Reference in a new issue