Read some where that AND and && have some difference. After searching on the internet I cam across the answer below so I thought I should share it with all of you. Another purpose of sending this email is to check if this group even exists. If you disagree with the text below then please let me know the actual difference between these two. AND is not the same like && for example: <?php $a && $b || $c; ?> is not the same like <?php $a AND $b || $c; ?> the first thing is (a and b) or c the second a and (b or c) 'cause || has got a higher priority than and, but less than && of course, using always [ && and || ] or [ AND and OR ] would be okay, but than you should at least respect the following: <?php $a = $b && $c; ?> <?php $a = $b AND $c; ?> the first code will set $a to the result of the comparison $b with $c, both have to be true, while the second code line will set $a like $b and THAN - after that - compare the success of this with the value of $c maybe useful for some tricky coding and helpful to prevent bugs
their functionality is the same but they differ in their order of precedence.. this link might help.. && is higher than AND
Really you should be using parenthesis anyway, to be certain PHP is interpreting it how you want it to. I'd say it's bad practice to rely on PHP for deciding in which order you wanted the conditions checked. Use parenthesis so it can only interpret it one way.
I would stick with && and || just to prevent any ambiguity in your coding. Save AND and OR for database queries.
Precedence can change in future versions - that would break your code. Parenthetical precedence will never change.
NET PHP SQL tutorials, references, examples for web building. ... Comparison and Logical operators are used to test for true or false. Comparison Operators. Comparison operators are used in logical statements to determine equality or difference between variables or values. Given that ... &&, and, (x < 10 && y > 1) is true ...