Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta http-equiv="X-UA-Compatible" content="IE=edge">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <link rel="preconnect" href="https://fonts.googleapis.com">
- <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
- <link href="https://fonts.googleapis.com/css2?family=Roboto&display=swap" rel="stylesheet">
- <title>PHP - </title>
- <style>
- body {
- background-color: #2E3440;
- color: #8FBCBB;
- font-family: 'Roboto', sans-serif;
- }
- #wrapper {
- margin: auto;
- width: 80%;
- }
- h1 {
- text-align: center;
- }
- section {
- font-size: 50;
- }
- footer {
- position: absolute;
- bottom: 0;
- height: 50px;
- margin: auto;
- width: 80%;
- }
- footer p {
- text-align: center;
- }
- </style>
- </head>
- <body>
- <div id="wrapper">
- <header>
- <h1>Aplikacje internetowe</h1>
- <h3>Temat: spr</h3>
- <hr>
- </header>
- <section>
- <?php
- // GR B
- // zad 1
- function bold($text)
- {
- echo "<b>" . $text . "</b>";
- }
- bold("chuj ci w dupe");
- echo "</br>";
- // zad 2
- function multiplicationOrDivision($num1, $num2, $operator)
- {
- switch ($operator) {
- case "*":
- echo "$num1 * $num2 = " . $num1 * $num2;
- break;
- case "/":
- if ($num2 == 0) {
- echo "Nie dziel przez zero ty .......";
- } else {
- echo "$num1 / $num2 = " . $num1 / $num2;
- }
- break;
- default:
- echo "Podano niewłaściwy operator arytmetyczny!";
- }
- }
- multiplicationOrDivision(123, 6, "*");
- echo "</br>";
- multiplicationOrDivision(10, 5, "/");
- echo "</br>";
- // zad 3
- echo "Dzisiaj jest " . date('d.m.Y') . " godzina " . date('H:i:s');
- echo "</br>";
- // zad 4
- // a. wielkie litery
- function uppercaseWords($givenText)
- {
- echo ucwords($givenText);
- }
- uppercaseWords("DuPa jasiu karuzela");
- echo "</br>";
- // b. małe litery
- function uppercaseFirst($givenText)
- {
- echo ucfirst($givenText);
- }
- uppercaseFirst("duPa Jasiu karuzela");
- echo "</br>";
- // zad 5
- function master($masterText)
- {
- // a Jestem -> swoje imie
- echo substr_replace($masterText, "Tomasz", 0, 6);
- echo "</br>";
- // b dodaj na koncu "PHP"
- echo substr_replace($masterText, " PHP", 15);
- echo "</br>";
- // c wyswietl "mistrzem"
- echo substr($masterText, 7);
- }
- master("Jestem mistrzem");
- ?>
- </section>
- <footer>
- <p>Tomasz Świątek 4bTI/2 2021/22</p>
- </footer>
- </div>
- </body>
- </html>
Add Comment
Please, Sign In to add comment