View Single Post
  #8 (permalink)  
Old 05-04-2008, 10:44 AM
Xav's Avatar   
Xav Xav is offline
Code Warrior
 
Join Date: Mar 2008
Location: On God's Planet
Posts: 9,852
Last Blog:
Web slideshow in JavaS...
Rep Power: 78
Xav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud ofXav has much to be proud of
Send a message via MSN to Xav
Default Re: Help with image upload script - need to make an if null statement

100% true? Wow, this must be a first!

Say you have a variable:
PHP Code:
$var 
If you don't assign any value to it, the variable has not been instantiated yet. Therefore, it contains no value at all - in other words, it's null.

However, if you use:
PHP Code:
$var ""
A value is being passed into the variable. Even though it's got a length of 0, it's still a string value - just a blank one. Therefore, the variable is now not null, as it contains a value (albeit a blank one).

Finally, if we pass a space to the variable:
PHP Code:
$var " "
Here, the value passed has a length of 1 - in programming, a space is considered as just another ASCII character, just like a letter or number. Therefore, this variable is also not null, as it holds a normal value - the only difference is, the value isn't visible to humans, as it's used to fill a gap.
__________________


Mr. Xav | Website | Forums | Blog
Reply With Quote