Part on Arrays is finished

This commit is contained in:
Patryk Hegenberg 2022-12-10 14:01:23 +01:00
parent da8d86c661
commit 7f7de38781
2 changed files with 11 additions and 12 deletions

View file

@ -9,17 +9,17 @@
</head> </head>
<body> <body>
<?php <?php
$name = "Dark Matter"; $books = [
$read = true; "Do Androids Dream of Electric Sheep",
if ($read) { "The Langoliers",
$message = "You have read $name"; "Hail Mary"
} ];
else {
$message = "You havn't read $name.";
}
?> ?>
<h1> <h1>Recommended Book</h1>
<?= $message?> <ul>
</h1> <?php foreach($books as $book) :?>
<li><?php echo $book; ?></li>
<?php endforeach; ?>
</ul>
</body> </body>
</html> </html>

View file

@ -1,6 +1,5 @@
body { body {
display: grid; display: grid;
place-items: center;
height: 100vh; height: 100vh;
margin: 0; margin: 0;
font-family: sans-serif; font-family: sans-serif;