‫Okay.
‫So now we're going to do our first challenge, which is extremely simple.
‫I would hope that most of you, if not all of you, would be able to do this.
‫And just remember that when I do a challenge, it has to only include things we've already gone over
‫in the course up to that point, so I can't throw in functions and stuff like that because we haven't
‫talked about that stuff.
‫We've only talked about variables, data types and so on.
‫All right.
‫So you'll have some starter HTML for this lesson in the PHP sandbox.
‫It's going to look like this.
‫It's basically a single blog post.
‫It has a title.
‫So Brad's PHP blog and then has this introduction to PHP, which is the name of the post, which it's
‫in the title and in the H one, and has an author and then has the body.
‫So the instructions are to put these values into variables and just display the blog post as is.
‫It'll look the same.
‫It'll look just like this.
‫There's no CSS, no tailwind or anything like that, but you just want to do the following.
‫So you want to add a variable called title and set it to the title of the blog post and the part of
‫the title in the page title.
‫Right.
‫Because in the page title here you have the the blog post title.
‫So you want that blog post title in that variable.
‫Then you want a variable for the author, then you want a variable for the body, and then a variable
‫for the page title with the string.
‫Brad's PHP blog and the title of the blog post.
‫So it should be this right here.
‫You can use concatenation or interpolation, so you can use either single quotes or double quotes to
‫combine the two strings.
‫If you use concatenation, be sure to escape the apostrophe slash single quote in Brad's.
‫So those are the instructions.
‫Very simple.
‫So pause the video and get that done and then check back.
‫All right.
‫So I'm going to jump over here into the index.php.
‫And let's first of all create our PHP tags.
‫We need an ending tag since we have HTML under it.
‫And then let's create our first variable which will be title.
‫And that's going to be the blog post title which is introduction to PHP.
‫So I'm going to just paste that in there okay.
‫Next one we're going to have is the author.
‫And the author is John Doe.
‫Okay.
‫Then we want to have the body.
‫And the body is going to be a string.
‫I'm just going to grab everything that's in this paragraph.
‫And you could put the paragraph tags in here as well if you had more than one paragraph.
‫And then we also want, as it says, a page title.
‫And the page title is going to include both the blog post title and this Brad's PHP blog.
‫So what we'll do is set this to a string, let's say Brad's.
‫Now I'm using single quotes and I want to have a quote in Brad's before the s.
‫So remember when we when we do that we have to prefix it with a backslash.
‫So we're going to escape this single quote.
‫So it's looked at as a literal quote.
‫And then S and then PHP blog okay.
‫Then I'm going to add the pipe character and then we're going to add the title.
‫So once again we have to concatenate onto that the title variable.
‫Now we can come down to where we want to put this stuff.
‫So in the page title let's get rid of this.
‫And of course we need to open up our PHP tags.
‫Now you can either do PHP echo or you can use the shorthand which is just the equal sign.
‫And then we're going to put here the page title and then we'll close that okay.
‫So that's the page title.
‫Then let's replace this right here.
‫With the title, so we'll do equal sign title.
‫And then we have the author.
‫So after the word by let's go and put in the author.
‫And then all this stuff here.
‫This text can be replaced with the body variable.
‫And if we save that, we come over here and reload.
‫We should see the same exact thing.
‫Except now we're using variables.
‫All right.
‫So really simple challenge.
‫But I wanted to throw something in there for you guys to do on your own.
‫All right.
‫So let's move on to the next video.