laPistola Posted November 25, 2008 Share Posted November 25, 2008 how do you write or, for exampe if (condition1) && (condition2) is do if condition1 and condition2 is true but how would you write for exmaple if (condition1) or (condition2) so it will follow the if, if condition 1 or 2 is true? i always do this buy else if's but if there is a better way then i would profer i. Thank you Link to comment https://forums.phpfreaks.com/topic/134204-solved-a-quick-one-with-conditionals/ Share on other sites More sharing options...
br3nn4n Posted November 25, 2008 Share Posted November 25, 2008 Yay something I can answer fully!! lol if (condition1 || condition2) { //do something } Link to comment https://forums.phpfreaks.com/topic/134204-solved-a-quick-one-with-conditionals/#findComment-698571 Share on other sites More sharing options...
laPistola Posted November 25, 2008 Author Share Posted November 25, 2008 i thought it was || thanks for the help Link to comment https://forums.phpfreaks.com/topic/134204-solved-a-quick-one-with-conditionals/#findComment-698573 Share on other sites More sharing options...
mark110384 Posted November 25, 2008 Share Posted November 25, 2008 if (condtion1) { //your statement } elseif (condtion2) { //your statement } else { //Does no match condtions } Link to comment https://forums.phpfreaks.com/topic/134204-solved-a-quick-one-with-conditionals/#findComment-698575 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.