iEntry 10th Anniversary Forum Rules Search
WebProWorld
Register FAQ Calendar Mark Forums Read
Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Share Thread: & Tags

Share Thread:

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-01-2007, 08:21 AM
WebProWorld Member
 
Join Date: Jul 2007
Posts: 36
kurt.santo RepRank 0
Default PHP isset () function

I understand that the isset () function tests if a variable has a value. But I do not understand that this includes 0, false or an empty string, but not null? What is the difference between 0 and null anyhow? And how can an empty string be a value?

kurt
Reply With Quote
  #2 (permalink)  
Old 07-01-2007, 11:28 AM
DaveSawers's Avatar
WebProWorld Veteran
 
Join Date: Dec 2006
Location: Calgary, Alberta, Canada
Posts: 492
DaveSawers RepRank 3DaveSawers RepRank 3
Default Re: PHP isset () function

Sounds like you need to use the function empty() if you're just trying to determine if a value has something useful in it, ie non zero or non empty string.

NULL effectively means that a value has never been set to anything. Setting a variable to zero or an empty string is therefore different to NULL because you deliberately set it to that value. This is an important distinction in programming. Some further explanation here: PHP: NULL - Manual
__________________
Dynamic Software Development
www.activeminds.ca
Reply With Quote
  #3 (permalink)  
Old 07-02-2007, 04:47 AM
WebProWorld Member
 
Join Date: Jul 2007
Posts: 36
kurt.santo RepRank 0
Default Re: PHP isset () function

Cheers,

Kurt
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Report post function crankydave WebProWorld: Guidelines/Announcements/Suggestions 3 02-07-2006 05:10 PM
Form and Function grease Graphics & Design Discussion Forum 0 09-19-2005 12:36 AM
Remember me function needed trippleweb WebProWorld: Guidelines/Announcements/Suggestions 1 04-27-2005 02:50 PM
Why has this function used in that code? abalfazl Web Programming Discussion Forum 2 03-11-2005 02:24 PM
PHP Function Calls via Links? southplatte Web Programming Discussion Forum 4 07-27-2004 11:47 PM


All times are GMT -4. The time now is 03:03 PM.



Search Engine Optimization by vBSEO 3.3.0