Test IF with multiple conditions in PHP

Solved
Hello,

I would like to know how to structure an IF test with multiple conditions in PHP.

Thanks in advance...
Configuration: Windows XP Firefox 3.5.3

5 answers

  1. Contributor
    You separate each condition with && , like in C!
    if ($a>1 && $a<5) echo "$a is between 1 and 5"


    && means AND
    || means OR

    if ($gender=="M" || $gender=="F") echo "you are a man or a woman"; else echo "you are neither a man nor a woman... maybe a Brazilian trans person?"
    21