Übung 6 - PHP Online

Form of PHP Sandbox

Enter Your PHP code here for testing/debugging in the Online PHP Sandbox. As in the usual PHP files, you can also add HTML, but do not forget to add the tag <?php in the places where the PHP script should be executed.



Your result can be seen below.

Result of php executing





Full code of Übung 6.php

  1. <?php
  2.  
  3. function zahlenXMalAusgeben($anzahl)
  4.     {
  5.         for($i=0; $i<$anzahl;$i++)
  6.         {
  7.             echo $i."<br>";
  8.         }
  9.     }
  10.  
  11.  
  12. function zahlenAusgaben($anfangszahl, $endzahl)
  13. {
  14.     for($i=$anfangszahl;$i<=$endzahl; $i++)
  15.     {
  16.         echo $i."<br>";
  17.     }
  18. }
  19.  
  20.     zahlenAusgaben(5,10);
  21. ?>
  22.  
  23. <?php
  24. function Tabelle($anfangszahl, $endzahl)
  25. {
  26.         echo ("Jetzt kommen die Zahlen von ".$anfangszahl. "bis" . $endzahl);
  27.         echo ("<table style='color: red' border='1' >");
  28.         for ($i=1;$i<=10; $i++)
  29.  {
  30.         echo "<tr><td>".$i."</td></tr>";
  31.     }
  32.      echo ("</table>");
  33. }
  34.  
  35. Tabelle(10,20);
  36. ?>
  37.  
  38.  
  39. <?php
  40. function nenneZahlenreihe($zahl)
  41. {
  42.         
  43.         for ($i=1;$i<=10; $i++)
  44.     {
  45.         echo ($i*$zahl)."<br>";
  46.     }
  47.      echo ("</table>");
  48. }
  49.  
  50. nenneZahlenreihe(5);
  51. ?>
  52.  
File Description
  • Übung 6
  • PHP Code
  • 13 Dec-2019
  • 795 Bytes
You can Share it: