From the course: PHP Essential Training

Unlock the full course today

Join today to access over 24,900 courses taught by industry experts.

NULL and empty

NULL and empty

- [Instructor] In this bit we're going to be talking about null. Null is a fancy term for nothing, for not having a value. It's not zero, it's not an empty string, it's the actual lack of a value. I mean, if we can set a value into a variable, then we also have to have some way to talk about the fact that variable might not have a value at all. And null allows us to do that. Let's take a look at it by first creating a page where we can work with null and I'm going to do that by opening up basic.html, and then choosing, Save As, and we're going to save this as null.php. So, null. Now, like true and false, the Booleans that we just talked about, null can either be written in lower case or in all upper case. And you will waste a lot of time arguing with people about the right way to do it in php, and whether one is better than the other or one has better performance than the other, but the truth is that they're case…

Contents