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 A
- // zad 1
- function underline ($text) {
- echo "<u>".$text."</u>";
- }
- underline("chuj ci w dupe");
- echo "</br>";
- // zad 2
- function AddOrSubstract ($num1, $num2, $operator) {
- switch ($operator){
- case "+":
- echo "$num1 + $num2 = ".$num1+$num2;
- break;
- case "-":
- echo "$num1 - $num2 = ".$num1 - $num2;
- break;
- default:
- echo "Podano niewłaściwy operator arytmetyczny!";
- }
- }
- AddOrSubstract(123, 6, "-");
- echo "</br>";
- AddOrSubstract(10, 7, "+");
- echo "</br>";
- // zad 3
- function getWeekday($date) {
- return date('l', strtotime($date));
- }
- echo getWeekday('2003-02-17');
- echo "</br>";
- // zad 4
- // a. wielkie litery
- function convertUppercase ($givenText) {
- echo strtoupper($givenText);
- }
- convertUppercase("DuPa Jasiu karuzela");
- echo "</br>";
- // b. małe litery
- function convertLowercase ($givenText) {
- echo strtolower($givenText);
- }
- convertLowercase("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