Jump to content

[SOLVED] many ifs in an if/else statement?


dsaba

Recommended Posts

i read the control structure about if/else and switch statements

but I didn't see anything about having multiple ifs or multiple cases

 

basically what I want to do is

IF this is true, IF this is also true, IF this is also true, and IF this too is true

THEN this one thing is true

 

i know how to make multiple thens on switch statements but not ifs

 

can u make multiple ifs just like this? what is the proper syntax where can I learn more about this?

sample if/else statement:

if ($row['username'] == $svideosubmitter)
($row['username'] == $svideosubmitter)
($row['username'] == $svideosubmitter)
($row['username'] == $svideosubmitter)
{
$query1 = bla bla bla query;
}
code]

sample switch statement:
[code]switch ($s4transvideoifsubitles)
{
  case "Yes" : 
  case "Maybe" : 
  case "Almost" : 
 $transifsubtitles_he = "Ken";
     break;
}

 

[/code]

Link to comment
https://forums.phpfreaks.com/topic/40213-solved-many-ifs-in-an-ifelse-statement/
Share on other sites

thanks ray i knew about the && syntax i didn't know if you could do it more than once though like more than 2 ifs in and if/else statement, i guess one time i tested it and it errored, from something else apparently as I now know it can be done

 

thank you ray! :)

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.