From the course: PHP for Web Designers

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Challenge: Inserting the appropriate alt text

Challenge: Inserting the appropriate alt text - PHP Tutorial

From the course: PHP for Web Designers

Start my 1-month free trial

Challenge: Inserting the appropriate alt text

In the previous chapter, we used the date function to get the first three letters of the current month's name. The codes there on line two in index.php in the Hansel and Petal site. And we used it to display an image of the month. However, if we go down to where that image is in the HTML. There it is down here. We can see that the alternate text is still hard-coded. And it says fresh tulips. Armed with the knowledge you've gained about arrays, I'd like you to think about how you might go about changing the alternate text so that it matches the image. Now, to help you, if you go to the handp_check folder, Open that and go to 04_03. In there is a text file called alternate.txt. And that contains some suggested alternate text for each month. There are actually quite a few ways you could do this. The challenge isn't to find the most sophisitcated approach. All you need is something that works. Take a look at the online documentation for the date function. Take a look at the formatting…

Contents