Possible Duplicate:
Reference – What does this symbol mean in PHP?
Whats the difference between these two in php?
if( $x==1 || $y==1) if( $x==1 && $y==1)
vs. (respectively)
if( $x==1 | $y==1) if( $x==1 & $y==1)
To my knowledge they both work the same | vs. || in php. But there has to be a difference!!!
||and&&are boolean operators, they take 2 arguments, convert each to a boolean, then returntrueorfalse.|and&are bitwise operators. They convert their arguments to binary and compare each bit. They return a binary number.