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 - PHP Tutorial
From the course: PHP Essential Training
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…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
(Locked)
Variables7m 50s
-
(Locked)
Strings4m 38s
-
(Locked)
String functions8m 53s
-
(Locked)
Numbers, part 1: Integers6m 27s
-
(Locked)
Numbers, part 2: Floating points5m 25s
-
(Locked)
Arrays10m
-
(Locked)
Associative arrays6m 37s
-
(Locked)
Array functions6m 33s
-
(Locked)
Booleans3m 50s
-
(Locked)
NULL and empty5m 15s
-
(Locked)
Type juggling and casting8m 27s
-
(Locked)
Constants4m 43s
-
(Locked)
-
-
-
-
-