s1yman Posted August 26, 2008 Share Posted August 26, 2008 if (isset($_POST['div7']) && ($_POST['div8'])) does that mean "if div7 and div8 exists ..." ? Quote 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.'; } ?> Quote 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! Quote 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. Quote 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... Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.