Shadab Wadiwala wrote:
Hi !!
I want to know what's the difference between the functions ----
isset() and empty()
I referred the function reference on php.net, but still couldn't
the exact answer to my query.
isset() checks if a key exists in a server array such as $_SESSION or
$_POST regardless of the value, which can be NULL or an empty string. I
never used empty(), but just by the name of it that function checks if
the value of a given variable or array key is considered "nothing" for
the respective variable type.
I always check if something is set in $_SESSION or $_POST (I rarely use
get) and then go with that value. In case it is not set I either set a
known good default value or I set a value that is guaranteed to generate
an obvious error (means a runtime error, crash, or such).
David
_______________________________________________
New York PHP Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk
NYPHPCon 2006 Presentations Online
http://www.nyphpcon.com
Show Your Participation in New York PHP
http://www.nyphp.org/show_participation.php