tomd79 Posted July 1, 2008 Share Posted July 1, 2008 in my code I have a simple if else.. if (a==NULL) { die "bad robot"; { else blah blah blah I want to be able to test 2 conditions in the if i.e. if (a==NULL & b==SomeValue) { die "bad robot"; { else blah blah blah been searching and come up blank.. anyone show me how? Link to comment https://forums.phpfreaks.com/topic/112746-solved-quick-syntax-question/ Share on other sites More sharing options...
trq Posted July 1, 2008 Share Posted July 1, 2008 Close but no cigar. if ($a == NULL && $b == 'SomeValue') { Link to comment https://forums.phpfreaks.com/topic/112746-solved-quick-syntax-question/#findComment-579048 Share on other sites More sharing options...
tomd79 Posted July 1, 2008 Author Share Posted July 1, 2008 ta... where the condition is the same for 2.. can I use one test.. (this failed when tested) like if ($a && $b == NULL); {} Link to comment https://forums.phpfreaks.com/topic/112746-solved-quick-syntax-question/#findComment-579050 Share on other sites More sharing options...
tomd79 Posted July 1, 2008 Author Share Posted July 1, 2008 works.. Link to comment https://forums.phpfreaks.com/topic/112746-solved-quick-syntax-question/#findComment-579054 Share on other sites More sharing options...
trq Posted July 1, 2008 Share Posted July 1, 2008 ta... where the condition is the same for 2.. can I use one test.. (this failed when tested) like if ($a && $b == NULL); {} No. Link to comment https://forums.phpfreaks.com/topic/112746-solved-quick-syntax-question/#findComment-579152 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.