'AND' 논리 연산자
'AND' 연산자는 논리적 AND 연산자이지만 =연산자보다 우선순위가 낮습니다.
'&&' 논리 연산자
'&&'는 논리적 AND 연산자이기도 하지만 =연산자보다 우선순위가 높습니다.
예시
다음 예에서는 'AND'와 '&&' 연산자의 차이점을 보여줍니다.
<!DOCTYPE html>
<html>
<head>
<title>PHP Example</title>
</head>
<body>
<?php
$x = true;
$y = false;
$result = $x AND $y;
print('$result = $x AND $y');
print("<br/>");
var_dump($result);
print("<br/>");
$result = $x && $y;
print('$result = $x && $y');
print("<br/>");
var_dump($result);
?>
</body>
</html> 출력
$result = $x AND $y bool(true) $result = $x && $y bool(false)