Hi, I've created a user-login system website and had read somewhere long ago that using if(empty()) function is better than using if(isset()) function in term of scalable. I ignored it at the time and just interested in it recently because if(isset()) have limited usage. since I never use if(empty()) before I was wondering that using it will carries the session values from one page to the another, and allover the web as long as browser still open like if(isset())? If so, I use definitely recoding my web. Thanks in advance.
The differences between isset() and empty() are: isset() checks only for NULL. If the variable is NULL, then it returns false. empty() checks for: So isset() would be faster, but empty() has a larger threshold for "empty" variables. They can be used independently, no matter what. They also don't affect the $_SESSION variables (or any for that matter) because it's simply a TRUE/FALSE check of the variable.
I usually see both functions used together, as in: if(isset() && !empty()) They both have their own individual uses separately, too.
Thanks for suggestions. This truly saves my day. The project I am working on is large and I'm just working alone.