PHP (if/else): Proper 'AND' for two if conditions.?

  • Thread starter Thread starter Chris B
  • Start date Start date
C

Chris B

Guest
In Javascript:
if(variable=="2") && (smeet[file]=="2"){ ...}

But what's the && in PHP. If i do that same thing in php, it comes up as T_Numeral_AND (not sure it says numeral lol, i forgot.)
 
&& is correct, but I think you need to put the WHOLE expression in parenthesis:

if ( (variable=="2") && (smeet[file] == "2") )
 
Back
Top