Using AND/OR in if else PHP statement

Yes. The answer is yes.
http://www.php.net/manual/en/language.operators.logical.php


Two things though:

  • Many programmers prefer && and || instead of and and or, but they work the same (safe for precedence).
  • $status="clear" should probably be $status == 'clear'. = is assignment, == is comparison.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)