- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Difference between the | and || or operator in php
'|' Bitwise OR operator
'|' operator is a bitwise OR operator and is used to set the bit to 1 if any of the corresponding bit is 1.
'||' Logical Or operator
'||' is a logical Or operator and works on complete operands as whole.
Following example, shows usage of '|' vs '||' operators.
<!DOCTYPE html> <html> <head> <title>PHP Example</title> </head> <body> <?php $x = 1; // 0001 $y = 2; // 0010 print('$x | $y = '); echo $x | $y; print("<br/>"); print('$x || $y = '); echo $x || $y; ?> </body> </html>
$x | $y = 3 $x || $y = 1
- Difference between the and$ operator in php
- Difference between !== and ==! operator in PHP
- Difference between the Ternary operator and Null coalescing operator in php
- Difference between the AND and && operator in php
- What is the difference Between AND, OR operator in MySQL while Retrieving the Rows?
- Difference between == and is operator in python.
- Difference between concat() and + operator in Java
- Difference between Python and PHP.
- Difference Between PHP and Python
- Explain difference between == and is operator in Python.
- Difference between bindParam and bindValue in PHP