user999222111
user999222111

Reputation: 1

PHP: Correct use of && in an if statment

I am trying to ensure that both conditions are true in my statement. Is the following the correct way to do so?

I'm not sure of my bracket placement etc.

if((functionOne($paramOne) && functionTwo($paramTwo)) == condition){

....

Upvotes: 0

Views: 42

Answers (1)

aqab0N
aqab0N

Reputation: 106

The correct way is

if(functionOne($paramOne) == condition && functionTwo($paramTwo) == condition){

Upvotes: 3

Related Questions