 Hey everybody, this is Brian and welcome to the Lamp Tutorial number 7. I have to apologize if I'm blasting eardrums out right now. I've been playing around with the recording volume. Hey kitty, daddy's recording now. Yes, thank you. Anyway, sorry, I've been playing around with the recording volume. Record my desktop is kind of fickle when it comes to the sound settings. I had to do a little bit of black magic and some googling, but I think I have it figured out. At least it sounds beautiful on my Linux box. All right, so moving right along, file new file from template, or you can just create it as you need depending on what IDE you're using. And go far, dub, dub, dub, and let's call this Tut 7 PHP. All right, as you can see, I'm using ActiveStates Komodo IDE 7.1 that may date this tutorial if you're viewing this in the near future. And it's like version 12 or something, but I'm sure the principles will stay the same. Now we have our beautiful HTML page already rendered for us. And we have our PHP code block. All of this we've covered in the past. Today, what we're going to cover are called variables. What is a variable? Well, you notice this two slashes, whack, whack. This has nothing to do with variables, by the way. This is a comment, meaning this will never get executed. So you'll see me type that out once in a while. Those are just instructions for you. They will never get executed. Sorry about that. Back on track, what is a variable? If you remember from science class, a variable is something that will change. For example, I had this girlfriend one time she changed her hair color about four times a month. She was a variable in my life. Anyways, so to create a variable, we'll say dollar sign person equals Bob. A variable is simply a label, something that you assign a meaning to or value to. It is denoted by a dollar sign. So anytime something starts with a dollar sign, that's a variable, meaning the value of this will change. Right now, person equals Bob, but we can change that. Let's do a quick example. We're going to echo out maybe if I can find my dollar sign here. There it is, person. And you're going to love the power of intelligence. Let's save this and let's just view this. See, it's printing out Bob. Now, let's actually change this around a little bit more. We'll say, now we want to say person equals Brian. Then we're just going to echo this out. Now it says Bob Ryan. Why? Because we're printing out twice. We're printing out Bob. We're printing out Brian. If we simply echo out, we didn't like that. It says zero. The reason why is I got this wrong. There we go. If all of this looks like voodoo magic, don't worry. We're going to explain this super quick. Remember, a variable is simply something that will change. So we've given a label called person. We know it's a variable because it starts with a dollar sign. We're assigning a value, see that equals sign, the string Bob. Then we're just echoing out person. Our variable. This dot, that's how you join two strings or concatenate a string. You notice how when we omit this, it just says Bob Ryan. Well, nothing in between. Sure, we could add a space here, but it's not the same. We want it on two different. So what we're doing is saying echo out person and echo out a hard return. That's effectively the same as calling echo twice. You could also say echo. So think of that little period as a shortcut. Very simple, very easy to remember. Just remember that period means you're joining two strings together. Remember how when I put the plus sign, it gave it a zero. Because what you're doing is you're trying to do mathematics at this point. You're saying person plus that, which is going to say false. So remember the period that is a gotcha in some languages like Java and C sharp and even C plus plus. So now we have Bob Ryan. Very simple, very easy to understand. But notice how we have this variable person. The label hasn't changed, but the value has. That's why it's called a variable because the value of this will change. Pretty simple, pretty easy tutorial. That's all for this tutorial. You just need to understand that a variable is simply something that'll change. This is Brian. Thank you for watching. I hope you found this educational and entertaining.