rikardoricz

grA

Dec 9th, 2021 (edited)
785
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 3.80 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 A
  60.                 // zad 1
  61.                 function underline ($text) {
  62.                     echo "<u>".$text."</u>";
  63.                 }
  64.                 underline("chuj ci w dupe");
  65.  
  66.                 echo "</br>";
  67.  
  68.                 // zad 2
  69.                 function AddOrSubstract ($num1, $num2, $operator) {
  70.                     switch ($operator){
  71.                         case "+":
  72.                             echo "$num1 + $num2 = ".$num1+$num2;
  73.                             break;
  74.                         case "-":
  75.                             echo "$num1 - $num2 = ".$num1 - $num2;
  76.                             break;
  77.                         default:
  78.                             echo "Podano niewłaściwy operator arytmetyczny!";
  79.  
  80.                     }
  81.                 }
  82.                 AddOrSubstract(123, 6, "-");
  83.                 echo "</br>";
  84.                 AddOrSubstract(10, 7, "+");
  85.                
  86.                 echo "</br>";
  87.                
  88.                 // zad 3
  89.                 function getWeekday($date) {
  90.                     return date('l', strtotime($date));
  91.                 }
  92.                
  93.                 echo getWeekday('2003-02-17');
  94.                
  95.                 echo "</br>";
  96.                
  97.                 // zad 4
  98.                 // a. wielkie litery
  99.                 function convertUppercase ($givenText) {
  100.                     echo strtoupper($givenText);
  101.                 }
  102.                 convertUppercase("DuPa Jasiu karuzela");
  103.                
  104.                 echo "</br>";
  105.                
  106.                 // b. małe litery
  107.                 function convertLowercase ($givenText) {
  108.                     echo strtolower($givenText);
  109.                 }
  110.                 convertLowercase("DuPa Jasiu karuzela");
  111.                
  112.                 echo "</br>";
  113.  
  114.                 // zad 5
  115.                 function master ($masterText) {
  116.                     // a Jestem -> swoje imie
  117.                     echo substr_replace($masterText, "Tomasz", 0, 6);
  118.                     echo "</br>";
  119.                     // b dodaj na koncu "PHP"
  120.                     echo substr_replace($masterText, " PHP", 15);
  121.                     echo "</br>";
  122.                     // c wyswietl "mistrzem"
  123.                     echo substr($masterText,7);
  124.  
  125.                 }
  126.                 master("Jestem mistrzem");
  127.  
  128.                
  129.             ?>
  130.  
  131.         </section>
  132.  
  133.         <footer>
  134.             <p>Tomasz Świątek 4bTI/2 2021/22</p>
  135.         </footer>
  136.  
  137.     </div>
  138. </body>
  139.  
  140. </html>
Add Comment
Please, Sign In to add comment