Jump to content

Archived

This topic is now archived and is closed to further replies.

atitthaker

Difference between && and AND

Recommended Posts

I know the diff that AND is loosely bound and && is tightly bound but what is the working diff of the same??? If poss plz give example...

Share this post


Link to post
Share on other sites
Its all to do with precedence, [b]&&[/b] and [b]||[/b] have a higher precedence than [b]AND[/b] and [b]OR[/b]. I see it like this...
[code]<?php
$a && $b OR $c; //Would be equal to ($a && $b) || $c;
$a AND $b || $c; //Would be equal to $a && ($b || $c);
$a && $b || $c; //Would be equal to ($a && $b) || $c;
?>[/code]
I think it's easier just to use parenthesise...

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.