This is a collection of questions that come up every now and then about syntax in PHP. This is also a Community Wiki, so everyone is invited to participate in maintaining this list.
It used to be hard to find questions about operators and other syntax tokens.¹
The main idea is to have links to existing questions on Stack Overflow, so it's easier for us to reference them, not to copy over content from …
我从这个if else语法得到了错误的输出,这里可能有什么问题?输出应该是错误的答案,但我得到了正确的答案输出.
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<?php
$math = 22+22+22;
if($math = 22222222) {
echo "Right answer";
}
else
{
echo "Wrong answer";
}
?>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)