jeudi 7 mai 2015

PHP `or` operator within an `if` statement

When doing an if statement can you use the or operator? e.g.

if ($1 == 1 or $2 = 2 ) {
    ...
}

Or is this completely wrong?

Note
I started of using .NET technoligies and I have found that the || operator does not seem to work in if statements

Can anyone help me to understand this or point me in the right direction to an answer? I have been on google and found the PHP Manual Ref to it here but this has not answered the question that I have.

Aucun commentaire:

Enregistrer un commentaire