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? Link to comment https://forums.phpfreaks.com/topic/223987-difference/ Share on other sites More sharing options...
Rifts Posted January 10, 2011 Share Posted January 10, 2011 it's better to use !empty Link to comment https://forums.phpfreaks.com/topic/223987-difference/#findComment-1157493 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. Link to comment https://forums.phpfreaks.com/topic/223987-difference/#findComment-1157494 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. Link to comment https://forums.phpfreaks.com/topic/223987-difference/#findComment-1157497 Share on other sites More sharing options...
Xtremer360 Posted January 10, 2011 Author Share Posted January 10, 2011 Form submission Link to comment https://forums.phpfreaks.com/topic/223987-difference/#findComment-1157516 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.