What do you guys prefer to use? What is better to use? isset() or empty()?
well, none of them 😃
if ($var) {} or if (!$var) {}
generally, the functions are different and have their own special cases, but mostly empty() will be more useful, cause empty values aren't useful (in most cases)
Would you recommend using this?:
if (empty($variable))
OR
if ($var == '')
hmm, there may be a reason, why empty() exists, but I think the second one is easier to read. Some time ago I used to use the 2nd, now I prefer just if($var) {}
why do you care anyway? You seem to be quite happy, not having bigger problems 😉
Originally posted by ir4z0r hmm, there may be a reason, why empty() exists, but I think the second one is easier to read. Some time ago I used to use the 2nd, now I prefer just if($var) {} why do you care anyway? You seem to be quite happy, not having bigger problems 😉
http://www.phpbuilder.com/board/showthread.php?s=&threadid=10234061