One Solution2:21 with Alena Holligan
Now that you've coded your solution to the practice problem, I'll show you how I did it. Remember, there are almost always more than one way to solve a problem.
We're looking for feedback on this new type of practice workshop. When you're finished, could you please review the workshop by filling out this short form? We appreciate it!
How did it go? 0:00 Were you able to complete the challenges? 0:02 If not, no worries. 0:04 You can watch my solution, compare it to what you wrote, 0:06 and then try the challenge again. 0:09 In step one, we were asked to rename the index file so 0:12 that PHP code will be executed. 0:16 For step two, we were asked to add a code block to the top of the index file. 0:19 Within this code block, we added title equals Top 5 Learning Tips. 0:24 For a simple string, we can use either single or double quotes. 0:30 For step three, 0:36 I replaced the two instances of the text title with my title variable. 0:36 For step four, I replaced the text, include quotes, 0:42 by using include and then within quotes, inc/learning_quotes.html. 0:48 Once again, single or double quotes would work here. 0:55 For step five, I replaced the text, include tips, 1:00 by using include, and then within quotes, 1:04 inc/learning_tips.html. 1:09 For step six, 1:13 I used the built in date function to replace the text date with today's date. 1:14 To get the full name of the month, I used the uppercase F. 1:20 For the two digit day, I used the lowercase d. 1:25 For a four digit year, I used the uppercase Y. 1:30 If your solution was different than mine, that's great. 1:36 Seldom is there only one solution. 1:40 If you see something interesting in my code, 1:43 you should try implementing it in your own program. 1:46 Let's take a look at this in the browser. 1:49 As you can see, we have the quotes on the left and the learning tips on the right. 1:54 And in the footer, is today's date. 2:00 If your solution was different than mine, that's great. 2:03 Seldom is there only one solution. 2:07 If you see something interesting in my code, 2:10 you should try implementing that in your own program. 2:12 Keep practicing so you can master these new skills. 2:15 Until next time, happy coding. 2:19
You need to sign up for Treehouse in order to download course files.Sign up