|
I'm not so sure about null being case sensitive.. true and false certainly aren't..
The difference between null and '' is basically that '' is a string thats been initialised but it is empty. In other words the string has been created but it holds nothing.
Null means the string, object, whatever doesn't exist. If you tested $Var and it was null it basically means that $Var doesn't actually exist.
If thats still not quite clear, let me put it like this:
You can have a plastic container full of sweets. Thats your variable containing something.
You can have an empty container. Thats your ''
You can have no container. Thats your null.
Make sense? - You know that the container could theoretically exist (even if it doesn't) so you can test for it by testing it against null.
Also you're using ' ' in your code. ' ' is not the same as ''. ' ' contains a space character which although prints nothing on the screen it is a valid ASCII character so its not the same as an empty string.
|