View Single Post
Old 10-07-2011, 11:21 AM   PM User | #7
tangoforce
Senior Coder

 
tangoforce's Avatar
 
Join Date: Feb 2011
Location: Your Monitor
Posts: 3,515
Thanks: 45
Thanked 440 Times in 429 Posts
tangoforce will become famous soon enoughtangoforce will become famous soon enough
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.
__________________
Please wrap your code in [php] tags. It is a sticky topic and it HELPS us to HELP YOU!
TIP: Coding styles and $end errors :::::::::: TIP: Warning: Cannot modify header information - headers already sent :::::::::: TIP: Quotes / Parse error: syntax error, unexpected T_..
PHP Code:
//Please don't use this for your form processing:
if (isset($_POST['submit']))
//Internet explorer has a bug and does not always send the submit value. 
Explanation: The IE if(isset($_POST['submit'])) bug explained.
tangoforce is offline   Reply With Quote
Users who have thanked tangoforce for this post:
Nobilis (10-08-2011)