# PHP Why does this && not trigger as false?

PHPServer Side ProgrammingProgramming

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

Live Demo

<!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
Published on 20-Nov-2020 09:57:04