Bummer! This is just a preview. You need to be signed in with a Basic account to view the entire video.
Start a free Basic trial
to watch this video
Let's practice some PHP to solidify your growing knowledge and make it stick.
It's okay to make multiple attempts before coming to a solution. That struggle to remember what you've learned , and apply it to the situation, is what causes the knowledge to take root.
Course: PHP Basics (Stage 4) PHP on the Web
Documentation
-
0:00
[MUSIC]
-
0:04
Hey everyone Alana here.
-
0:06
Practice is vital to becoming a proficient developer.
-
0:10
It solidifies what you learned, causing it to stick in your memory.
-
0:14
With deliberate practice it becomes quicker and
-
0:17
easier to solve the challenges you'll face everyday.
-
0:21
So let's practice some PHP.
-
0:24
This practice session is intended to follow the PHP basics course.
-
0:28
If you haven't taken that course already, or
-
0:31
find this practice session too difficult, then review the PHP basics course first.
-
0:36
Check the notes associated with this video for additional links and resources.
-
0:41
Let's review the challenge.
-
0:43
This challenge includes some helper files for the HTML.
-
0:47
Besides the index file, there's a CSS file and
-
0:51
two files we'll be including into our page.
-
0:53
The instructions file contains the comments for
-
0:57
each of the six steps required to complete this challenge.
-
1:01
You will not be adding anything to the instructions file.
-
1:04
Instead, you'll implement each step for the index file.
-
1:13
Step one, rename the index file so that the PHP code will be executed.
-
1:19
Step two, add a code block to the top of the index file, and
-
1:23
create a variable named $title.
-
1:26
Set its value equal to "Top 5 Learning Tips".
-
1:33
Step three,
-
1:34
replace the two instances of the text title with your variable in such a way
-
1:39
that in a web browser the values of that variable will be displayed on the page.
-
1:46
Step four, replace the text include quotes by including
-
1:51
the HTML file learning quotes dot html from the inc folder.
-
1:58
Step five, replace the text include tips by including
-
2:02
the html file learning tips that html from the inc folder.
-
2:07
Step six, use the built-in date function
-
2:11
to replace the text date with today's date.
-
2:16
For this step,
-
2:17
you can use the documentation to figure out the specific formatting.
-
2:23
You may choose any format you wish.
-
2:26
I'll be using the full name of the month, followed by a space and
-
2:30
the two digit day, followed by a comma, space, then the four digit year.
-
2:37
Example, December 9th, 1906.
-
2:38
At any point, you can
-
2:41
preview the site in a browser by choosing the eye in the top right hand corner.
-
2:48
Remember, it's okay to make multiple attempts before coming to a solution.
-
2:53
That struggle to remember what you've learned and
-
2:56
apply it to the situation is what causes the knowledge to take root.
-
3:00
If you do get stuck I've included additional resources in the notes
-
3:04
associated with this video.
-
3:07
Go ahead and give it a try and I'll show you my solution in the next video.
You need to sign up for Treehouse in order to download course files.
Sign up