超简单的php程序!可是报错!
程序员文章站
2022-04-11 11:05:59
...
if ($_COOKIE['Onclick_Button_ID'] == "btn-newquestion")
{
$display_block = cnm
END_OF_TEXT;
echo $display_block;
}
else if ($_COOKIE['Onclick_Button_ID'] == "btn-viewquestion")
{
$display_block = qnmd
EOF;
echo $display_block;
}
?>
这样就报:
Parse error: syntax error, unexpected end of file in C:\wamp\www\Zhuzhenqi\Modal_Content.php on line 16
可是当我改成这样时,就没错了:
if ($_COOKIE['Onclick_Button_ID'] == "btn-newquestion")
{
$display_block = cnm
END_OF_TEXT;
echo $display_block;
}
else if ($_COOKIE['Onclick_Button_ID'] == "btn-viewquestion")
{
echo $display_block;
}
?>
但是我实在没看出来
$display_block = qnmd
EOF;
有什么问题啊
{
$display_block = cnm
END_OF_TEXT;
echo $display_block;
}
else if ($_COOKIE['Onclick_Button_ID'] == "btn-viewquestion")
{
$display_block = qnmd
EOF;
echo $display_block;
}
?>
这样就报:
Parse error: syntax error, unexpected end of file in C:\wamp\www\Zhuzhenqi\Modal_Content.php on line 16
可是当我改成这样时,就没错了:
if ($_COOKIE['Onclick_Button_ID'] == "btn-newquestion")
{
$display_block = cnm
END_OF_TEXT;
echo $display_block;
}
else if ($_COOKIE['Onclick_Button_ID'] == "btn-viewquestion")
{
echo $display_block;
}
?>
但是我实在没看出来
$display_block = qnmd
EOF;
有什么问题啊
回复讨论(解决方案)
定界符结尾前面或后面有空格
删去 EOF; 后面的空格
cnm qnmd
这两个字符串 被系统识别到, 现在是河蟹社会,php里不允许有脏话,所以被屏蔽了!
好吧 表示没用过
定界符后面有空格,自己检查一下