Home >> PHP >> Logical operators in PHP

Logical operators in PHP

1-Operator-            X and Y
   Name-                 AND
   Description-        True if both X and Y are true
   Example-            X=6,Y=3 (X<8 and Y>2) return true

2-Operator-            X or Y
   Name-                 OR
   Description-        True if either or both X and Y are true
   Example-            X=6,Y=3(X==6 or Y==5) return true

3-Operator-            X xor Y
   Name-                 XOR
   Description-        True if either X or Y is true, but not both.
   Example-            X=6,Y=3(X==6 xor Y==5) return false

4-Operator-            X&&Y
   Name-                 AND
   Description-        True if both X and Y are true
   Example-            X=6,Y=3 (X<8 && Y>2) return true

5-Operator-            X||Y
   Name-                 OR
   Description-        True if either or both X and Y are true.
   Example-            X=6,Y=3 (X<8 || Y==3) return true

6-Operator-            !X
   Name-                 Not
   Description-        True if X is not true.
   Example-              X=6,Y=3 !(X==Y)return true

Post Your Comment

Next Questions
Array Operators
String
addcslashes() function
addslashes() function
chunk_split() function
crc32() function
explode() function
implode() function
join() function
ltrim() function
md5() function
metaphone() function
money_format() function
nl2br() function
number_format() function
ord() function
parse_str() function
printf() function
quotemeta() function
rtrim() function
sha1() function
sha1_file() function
similar_text() function
str_ireplace() function
str_pad() function

Copyright ©2022 coderraj.com. All Rights Reserved.