| Beide Seiten, vorherige Überarbeitung Vorherige Überarbeitung Nächste Überarbeitung | Vorherige Überarbeitung |
| informatik:php:php-programmierkurs:php-p3 [2018/02/15 23:48] – jonathan.pfeiffer | informatik:php:php-programmierkurs:php-p3 [2024/10/14 20:45] (aktuell) – jonathan.pfeiffer |
|---|
| | <code>*</code> | <code>Multiplikation</code> | | | <code>*</code> | <code>Multiplikation</code> | |
| | <code>/</code> | <code>Division</code> | | | <code>/</code> | <code>Division</code> | |
| | <code>%</code> | Modulo-Operation: der Rest bei einer ganzzahligen Division. So ergibt z. B. 7 % 3 den Wert 1 , denn 7 dividiert durch 3 ergibt 2 , Rest 1 | | | <code>%</code> | <code>Modulo-Operation: der Rest bei einer ganzzahligen Division. So ergibt z. B. 7 % 3 den Wert 1 , denn 7 dividiert durch 3 ergibt 2 , Rest 1</code> | |
| | <code>**</code> | Potenzieren mithilfe des Exponentialoperators (seit PHP 5.6). Ein Beispiel: 2 ** 3 , gesprochen: 2 hoch 3. | | | <code>**</code> | <code>Potenzieren mithilfe des Exponentialoperators (seit PHP 5.6). Ein Beispiel: 2 ** 3 , gesprochen: 2 hoch 3.</code> | |
| | <tabbox #1> |
| | **Ein Beispiel mit einer etwas umfangreicheren Berechnung:**\\ |
| | \\ |
| | <code php> |
| | <!DOCTYPE html><html><head><meta charset="utf-8"></head><body> |
| | <?php |
| | $liter1 = 16; |
| | $liter2 = 23; |
| | $liter3 = 34; |
| | $preis = 1.35; |
| | $gesamtzahlung = ($liter1 + $liter2 + $liter3) * $preis; |
| | echo $gesamtzahlung; |
| | ?> |
| | </body></html |
| | </code> |
| | \\ |
| | Nutze [[http://www.writephponline.com/]] um folgende Frage zu beantworten.\\ |
| | Kopiere dazu den PHP-Code, füge ihn ein und klicke auf ''Run Code''.\\ |
| | \\ |
| | <quizlib id="quiz" rightanswers="['98.55']" submit="Check Answers"> |
| | |
| | <question title="Wie lautet die Ausgabe des Programms im Browser?" type="text"></question> |
| | |
| | |
| | </quizlib> |
| | |
| | <tabbox #2> |
| | <html> |
| | {{url>https://learningapps.org/watch?app=6022912 80%,600px|iFrame not installed}} |
| | |
| | </html> |
| |
| </tabbox> | </tabbox> |
| * Theis, T. (2017): Einstieg in PHP 7 und MySQL. (Rheinwerk Verlag) Bonn | * Theis, T. (2017): Einstieg in PHP 7 und MySQL. (Rheinwerk Verlag) Bonn |
| |
| {{tag>[informatik thema php html html-formulare lernpfad operatoren]}} | {{tag>[informatik thema php php-programmierkurs html html-formulare lernpfad operatoren]}} |