Possible Duplicate:
Why do I need the isset() function in php?
whats the difference if I say
if($value){}
vs
if (isset($value)){}
I had been asked to change if($value) to isset($value)
thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
PHP generates a warning (Undefined variable) when you access an undefined variable using
if ($value)Use
if (isset($value))to test if a variable has been declared.Use
if ($value)if you know the variable has been declared, and you want to evaluate the contents as boolean.