‫Okay.
‫So now we're going to talk about variables which are pretty much included in any programming language.
‫And you can think of variables as containers that hold data or specific values that you can later use
‫to access that data, or that specific value.
‫And variables can hold different types of data, whether it's a string, integer, boolean value, etcetera.
‫So an example right here we have a variable called name and it holds the value of Brad the string.
‫Brad okay.
‫Now in PHP there are some rules that we have to follow when naming variables.
‫So first off they're prefixed with a dollar sign.
‫And a lot of people don't like that.
‫They think it can start to make the code look messy.
‫And I kind of agree with that.
‫But it's just something that we have to deal with in PHP.
‫So every variable prefixed with a dollar sign, they also must start with a letter or an underscore.
‫They cannot start with a number, even though the next rule.
‫They can contain letters, numbers, and underscore, but they can only start with a letter or an underscore.
‫Can't start with a number.
‫They can have a number somewhere in there.
‫They just can't start with it.
‫They're also case sensitive.
‫So this version of name with an uppercase N is a different variable than this version of name with a
‫lowercase n.
‫All right.
‫So keep those rules in mind.
‫Now when it comes to variables that have multiple words there's different naming conventions that we
‫can use.
‫So the first one is underscore formatting.
‫And that would be every word has an underscore between it.
‫So server name.
‫If this was called server name object then it would have an underscore.
‫And then the word object okay.
‫Now this is commonly used internal to PHP.
‫So a lot of the functions that come with the language that you can use use this formatting.
‫So there are people there are developers that like to use that to kind of match that syntax.
‫The next is CamelCase which is it starts with a lowercase.
‫But then every word after that starts with an uppercase.
‫And this is the convention that I prefer.
‫I use this in just about well, yeah.
‫In every language that I use, whether it's JavaScript, PHP, Ruby.
‫So this is what I'll be using for my custom variables.
‫But again, some of the internal variables that we'll use will have an underscore.
‫And also I should mention function names as well.
‫Now Pascalcase is similar to CamelCase, except it also starts with an uppercase.
‫And this is common for classes.
‫When you create a class of whatever user or authentication, you're going to want to start it with an
‫uppercase and then lowercase.
‫Not too common, maybe with like things like database parameters variables.
‫For that you might use lowercase, but you don't see that too much because it looks all jumbled together.
‫It's much easier to see server name with any of these three over this.
‫All right.
‫So keep that in mind.
‫Now we're going to jump into our code here.
‫And this is just basically the same thing we left off with.
‫I just got rid of the stuff at the top.
‫So remember I said that usually you're not going to echo out just straight strings like this.
‫Usually they'll be in variables.
‫So let's create a couple at the top here.
‫So I'm going to come up here.
‫Let's open up our PHP tag.
‫And since we have HTML below it we're going to close it.
‫And let's create a variable called title.
‫And we'll set that to learn PHP from scratch.
‫So now what we can do is replace this.
‫In fact I'm going to use the shorthand for this as well.
‫So just the equal sign.
‫And then we can simply do title like that down here.
‫Same thing we can get rid of.
‫All this and just say title.
‫Save it.
‫And if I reload, we see the same thing.
‫So what else do we have here?
‫We have welcome to the course.
‫So we call that the heading.
‫So we'll come up here and let's create a variable called heading.
‫And it's going to be a string.
‫Welcome.
‫And in the next video we're going to talk about data types.
‫Right now these are all strings.
‫So we'll say welcome to the course.
‫And then we'll replace this this string here with heading and then the body.
‫So I don't want to put the HTML in there.
‫So I'm going to actually just.
‫Get rid of that.
‫And then inside the paragraph and we'll put in our PHP short tag.
‫And I'm just going to cut this.
‫We'll cut that out.
‫And that's going to be called body.
‫So we'll say body close that.
‫And then up at the top create a variable called body and set that to a string with that text.
‫So now if we say save and reload we're going to see the same exact thing.
‫But it's much neater because we now have this data up here.
‫So if we want to change it like let's say I want it to be just PHP from scratch instead of learn PHP
‫from scratch, I can get rid of that, learn reload and it reflects in the title up here and in the
‫heading.
‫But I'm going to put it back to learn.
‫All right.
‫So that's the basics.
‫Very very very simple stuff that we're talking about right now.
‫But it's important for people that are brand new to PHP and brand new to to programming in general.
‫So in the next video, we're going to talk more about the data types that we hold in these variables.