This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
en:web_development:media:named_arrays [2021/12/25 14:40] mag |
en:web_development:media:named_arrays [2023/08/16 09:33] (current) |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Web Development Lesson | + | ====== Web Development Lesson |
| ===== Named Arrays ===== | ===== Named Arrays ===== | ||
| ==== Objective ==== | ==== Objective ==== | ||
| Line 181: | Line 181: | ||
| $animals[' | $animals[' | ||
| * We can read the array in the same way. Add this code to the < | * We can read the array in the same way. Add this code to the < | ||
| - | < | + | < |
| * Now view the page and check the results. | * Now view the page and check the results. | ||
| Line 204: | Line 204: | ||
| <?php | <?php | ||
| } | } | ||
| - | ?> | + | ?></ |
| * There are a couple of things to note here. | * There are a couple of things to note here. | ||
| - | * We've used a couple of new HTML tags. < | + | * We've used a couple of new HTML tags. < |
| * Secondly, we've changed the way we encode the HTML block. Rather than include all the HTML inside a string, which requires us to add < | * Secondly, we've changed the way we encode the HTML block. Rather than include all the HTML inside a string, which requires us to add < | ||
| * This is much more readable for me. | * This is much more readable for me. | ||
| * Refresh your page and check that it works as it should. | * Refresh your page and check that it works as it should. | ||
| + | * It needs a bit of styling. Try this or add your own. | ||
| + | < | ||
| + | display: block; | ||
| + | text-align: center; | ||
| + | font-family: | ||
| + | color: green; | ||
| + | }</ | ||
| ==== While Loop ==== | ==== While Loop ==== | ||
| Line 228: | Line 235: | ||
| * So this is another way of running the same code multiple times. | * So this is another way of running the same code multiple times. | ||
| - | [[en: | + | [[en: |