Jump to content

Php If with multiple variables?


slim_jimmy7

Recommended Posts

I can't find if this is legit php code anywhere, so I though I would ask here!  Basically I want to see if a variable is greater than multiple variables.

 

Sorry if this is simple, I am new at php!

 

Would this be the way to see if a variable is greater than all the variables?

 

$a = 1;

$b = 2;

$c = 3;

$d = 4;

$value = 10;

 

  if ($c > $a AND $b AND $d) {

      $variable = $value;

} else {

      $variable = 0;

}

 

Link to comment
https://forums.phpfreaks.com/topic/197144-php-if-with-multiple-variables/
Share on other sites

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.