 
  Data Structure Data Structure
 Networking Networking
 RDBMS RDBMS
 Operating System Operating System
 Java Java
 MS Excel MS Excel
 iOS iOS
 HTML HTML
 CSS CSS
 Android Android
 Python Python
 C Programming C Programming
 C++ C++
 C# C#
 MongoDB MongoDB
 MySQL MySQL
 Javascript Javascript
 PHP PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
PHP Why does this && not trigger as false?
This is because if you use && both conditions must be true. If any one condition becomes false then the overall condition evaluates to false.
The PHP code is as follows −
Example
<!DOCTYPE html> <html> <body> <?php    $firstCondition= "John";    $secondCondition = "David";    if ($firstCondition == "John" && $secondCondition == "David" && ($firstCondition == "Mike" || $firstCondition == "John")) {       echo "The above condition is true";    } else {       echo "The above condition is not true";    } ?> </body> </html>  Output
The above condition is true
Advertisements
 