Xtremer360 Posted January 10, 2011 Share Posted January 10, 2011 This is going to seem like a stupid question but I'm curious about it anyway. Isn't isset and !empty do the same? Quote Link to comment Share on other sites More sharing options...
Rifts Posted January 10, 2011 Share Posted January 10, 2011 it's better to use !empty Quote Link to comment Share on other sites More sharing options...
johnny86 Posted January 10, 2011 Share Posted January 10, 2011 No it's not same. There are many situations where the return values differ. Check PHP Manual for it but one example would be: <?php $var = array(); isset($var) // TRUE !empty($var) // FALSE The return values are different depending what you use. Quote Link to comment Share on other sites More sharing options...
Pikachu2000 Posted January 10, 2011 Share Posted January 10, 2011 Whether one is 'better' would depend on how you intend to use, and what conditions you want to return what result. Quote Link to comment Share on other sites More sharing options...
Xtremer360 Posted January 10, 2011 Author Share Posted January 10, 2011 Form submission Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.