Possible Duplicate:
PHP - and / or keywords
if($foo == 0 or $bar == 1 || $baz == 2)
{
...
}
Is it better to use "or" or || and is there any significant difference between them?
Possible Duplicate:
PHP - and / or keywords
if($foo == 0 or $bar == 1 || $baz == 2)
{
...
}
Is it better to use "or" or || and is there any significant difference between them?
It's basically a matter of choice.
There is a difference however, when it comes to operand precedence:
if ( false && false || true ) // true
if ( false AND false || true ) // false
See it here in action: http://codepad.viper-7.com/zvFPzR