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