rikardoricz

grB

Dec 9th, 2021 (edited)
880
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.62 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3.  
  4. <head>
  5.     <meta charset="UTF-8">
  6.     <meta http-equiv="X-UA-Compatible" content="IE=edge">
  7.     <meta name="viewport" content="width=device-width, initial-scale=1.0">
  8.     <link rel="preconnect" href="https://fonts.googleapis.com">
  9.     <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
  10.     <link href="https://fonts.googleapis.com/css2?family=Roboto&display=swap" rel="stylesheet">
  11.     <title>PHP - </title>
  12.  
  13.     <style>
  14.         body {
  15.             background-color: #2E3440;
  16.             color: #8FBCBB;
  17.             font-family: 'Roboto', sans-serif;
  18.         }
  19.  
  20.         #wrapper {
  21.             margin: auto;
  22.             width: 80%;
  23.         }
  24.  
  25.         h1 {
  26.             text-align: center;
  27.         }
  28.  
  29.         section {
  30.             font-size: 50;
  31.         }
  32.  
  33.         footer {
  34.             position: absolute;
  35.             bottom: 0;
  36.             height: 50px;
  37.             margin: auto;
  38.             width: 80%;
  39.         }
  40.  
  41.         footer p {
  42.             text-align: center;
  43.         }
  44.     </style>
  45.  
  46. </head>
  47.  
  48. <body>
  49.     <div id="wrapper">
  50.  
  51.         <header>
  52.             <h1>Aplikacje internetowe</h1>
  53.             <h3>Temat: spr</h3>
  54.             <hr>
  55.         </header>
  56.  
  57.         <section>
  58.             <?php
  59.             // GR B
  60.             // zad 1
  61.             function bold($text)
  62.             {
  63.                 echo "<b>" . $text . "</b>";
  64.             }
  65.             bold("chuj ci w dupe");
  66.  
  67.             echo "</br>";
  68.  
  69.             // zad 2
  70.             function multiplicationOrDivision($num1, $num2, $operator)
  71.             {
  72.                 switch ($operator) {
  73.                     case "*":
  74.                         echo "$num1 * $num2 = " . $num1 * $num2;
  75.                         break;
  76.                     case "/":
  77.                         if ($num2 == 0) {
  78.                             echo "Nie dziel przez zero ty .......";
  79.                         } else {
  80.                             echo "$num1 / $num2 = " . $num1 / $num2;
  81.                         }
  82.                         break;
  83.                     default:
  84.                         echo "Podano niewłaściwy operator arytmetyczny!";
  85.                 }
  86.             }
  87.             multiplicationOrDivision(123, 6, "*");
  88.             echo "</br>";
  89.             multiplicationOrDivision(10, 5, "/");
  90.  
  91.             echo "</br>";
  92.  
  93.             // zad 3
  94.             echo "Dzisiaj jest " . date('d.m.Y') . " godzina " . date('H:i:s');
  95.  
  96.  
  97.             echo "</br>";
  98.  
  99.             // zad 4
  100.             // a. wielkie litery
  101.  
  102.             function uppercaseWords($givenText)
  103.             {
  104.                 echo ucwords($givenText);
  105.             }
  106.             uppercaseWords("DuPa jasiu karuzela");
  107.  
  108.             echo "</br>";
  109.  
  110.             // b. małe litery
  111.             function uppercaseFirst($givenText)
  112.             {
  113.                 echo ucfirst($givenText);
  114.             }
  115.             uppercaseFirst("duPa Jasiu karuzela");
  116.  
  117.             echo "</br>";
  118.  
  119.             // zad 5
  120.             function master($masterText)
  121.             {
  122.                 // a Jestem -> swoje imie
  123.                 echo substr_replace($masterText, "Tomasz", 0, 6);
  124.                 echo "</br>";
  125.                 // b dodaj na koncu "PHP"
  126.                 echo substr_replace($masterText, " PHP", 15);
  127.                 echo "</br>";
  128.                 // c wyswietl "mistrzem"
  129.                 echo substr($masterText, 7);
  130.             }
  131.             master("Jestem mistrzem");
  132.  
  133.  
  134.             ?>
  135.  
  136.         </section>
  137.  
  138.         <footer>
  139.             <p>Tomasz Świątek 4bTI/2 2021/22</p>
  140.         </footer>
  141.  
  142.     </div>
  143. </body>
  144.  
  145. </html>
Add Comment
Please, Sign In to add comment