Home  >  Article  >  Backend Development  >  超简略的php程序!可是报错

超简略的php程序!可是报错

WBOY
WBOYOriginal
2016-06-13 11:59:39819browse

超简单的php程序!可是报错!
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;          
有什么问题啊
------解决方案--------------------
定界符结尾前面或后面有空格
------解决方案--------------------
删去 EOF; 后面的空格

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn