PC Nerd Posted March 29, 2007 Share Posted March 29, 2007 hi guys simple question: if i have a while loop, can i use an || expression, and if both conditions or it true or fals ( as in its not or its and) eg if($a == "abc" || $b == "bcd") { } if both $a and $b were equal to what their teested against, would it still return true? thankx for your help Link to comment https://forums.phpfreaks.com/topic/44734-solved-while-loop-condition/ Share on other sites More sharing options...
Lytheum Posted March 29, 2007 Share Posted March 29, 2007 Not quite sure what you're asking, but if: if($a == "abc" || $b == "bcd") { $a = abc; $b = bcd; //returns true $a = kds; $b = bcd; //returns true $a = 123; $b = 456; //returns false } Link to comment https://forums.phpfreaks.com/topic/44734-solved-while-loop-condition/#findComment-217212 Share on other sites More sharing options...
PC Nerd Posted March 29, 2007 Author Share Posted March 29, 2007 thats exactly it, thankyou Link to comment https://forums.phpfreaks.com/topic/44734-solved-while-loop-condition/#findComment-217213 Share on other sites More sharing options...
Lytheum Posted March 29, 2007 Share Posted March 29, 2007 No problem, glad I could help. Link to comment https://forums.phpfreaks.com/topic/44734-solved-while-loop-condition/#findComment-217214 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.