Jump to content

[SOLVED] if then if else neither


simon551

Recommended Posts

Hi. Having a mental block. Can you help me write:

if (a=true) 
{ if (b=true) 
   {  foo;
   } else (neither a nor b = true)
      { do something;
      }
}

I'm stuck on the the else part. the way it is written, the else is based on a=true. but I want it to be based on both a and b. ?

Link to comment
https://forums.phpfreaks.com/topic/157745-solved-if-then-if-else-neither/
Share on other sites

thanks but I really need (a) and (b) to be true. Maybe I should have stated the question: if (a and b) then, else.

if (a) {

if (b) {

x

}

} else { [y]}

 

I'm going after that x space where both a and b are true and also need to know if both are not true. I don't particularly care if just one of a or b is true.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.