Part on Arrays is finished
This commit is contained in:
parent
da8d86c661
commit
7f7de38781
2 changed files with 11 additions and 12 deletions
22
index.php
22
index.php
|
|
@ -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>
|
||||||
|
|
@ -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;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue