From 11a260008e44e5bd6a172d5317a613caa49cffcf Mon Sep 17 00:00:00 2001 From: Schuledaniel Date: Fri, 16 Jan 2026 08:15:01 +0100 Subject: [PATCH] add stuff of 16. Jan 26 --- Zweites Jahr/README.md | 5 +++-- Zweites Jahr/modulo.php | 26 ++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 Zweites Jahr/modulo.php diff --git a/Zweites Jahr/README.md b/Zweites Jahr/README.md index a0c9087..9516859 100644 --- a/Zweites Jahr/README.md +++ b/Zweites Jahr/README.md @@ -8,11 +8,12 @@ Wichtige Informationen - Stundenplan - [Link](https://wvss-mannheim.webuntis.com/WebUntis/?school=wvss-mannheim#/basic/timetablePublic/class?entityId=2583) +## 16-01-26 - PHP +- Modulo + ## 14-01-26 - PHP - - Kryptologie (LBT3) - ## 12-12-25 - PHP (SQL) - Aufgabe von gester überarbeitet - Unterrichts Projekt: diff --git a/Zweites Jahr/modulo.php b/Zweites Jahr/modulo.php new file mode 100644 index 0000000..ee2e03c --- /dev/null +++ b/Zweites Jahr/modulo.php @@ -0,0 +1,26 @@ +"; + +$ergebnis = 7%3; +echo "Restwert: ".$ergebnis."
"; + +// Ist ZAhl gerade? + +$zahl = 5; + +if($zahl % 2 == 0)echo "$zahl is gerade.
"; +else echo "$zahl ist ungerade.
"; + +// LEtze Zahl einer ZAhl ermitteln + +$zahl = 123; + +echo $zahl % 10; // In Zahl steht 3 wenn $zahl%=3 + +echo "
".$zahl."
"; + +echo (int)($zahl/10); // 123 -> 12 \ No newline at end of file