s1yman Posted August 26, 2008 Share Posted August 26, 2008 if (isset($_POST['div7']) && ($_POST['div8'])) does that mean "if div7 and div8 exists ..." ? Link to comment https://forums.phpfreaks.com/topic/121449-solved-does-this-small-isset-make-sense/ Share on other sites More sharing options...
zq29 Posted August 26, 2008 Share Posted August 26, 2008 No, you need to use isset() on both variables: <?php if(isset($_POST['div7']) && isset($_POST['div8'])) { echo 'Both $_POST[\'div7\'] and $_POST[\'div8\'] is set.'; } ?> Although, your example may actually work, as I believe the above is actually the same as: <?php if($_POST['div7'] && $_POST['div8']) { echo 'Both $_POST[\'div7\'] and $_POST[\'div8\'] is set.'; } ?> Link to comment https://forums.phpfreaks.com/topic/121449-solved-does-this-small-isset-make-sense/#findComment-626273 Share on other sites More sharing options...
s1yman Posted August 26, 2008 Author Share Posted August 26, 2008 No, you need to use isset() on both variables: Kool - Thanks mate! Link to comment https://forums.phpfreaks.com/topic/121449-solved-does-this-small-isset-make-sense/#findComment-626320 Share on other sites More sharing options...
PFMaBiSmAd Posted August 26, 2008 Share Posted August 26, 2008 Or provide a coma separated list of values to one isset() statement. Link to comment https://forums.phpfreaks.com/topic/121449-solved-does-this-small-isset-make-sense/#findComment-626382 Share on other sites More sharing options...
zq29 Posted August 27, 2008 Share Posted August 27, 2008 Or provide a coma separated list of values to one isset() statement. Ha! I've never noticed that you could do that - Cheers for pointing that out, I've never actually read the man page for isset... Link to comment https://forums.phpfreaks.com/topic/121449-solved-does-this-small-isset-make-sense/#findComment-626711 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.