gpt4 book ai didi

php - 解析错误 : syntax error, 意外的 $end in E :\xampp\htdocs\announcements\announcement. php on line 143

转载 作者:可可西里 更新时间:2023-11-01 00:27:52 26 4
gpt4 key购买 nike

我收到这个错误信息

Parse error: syntax error, unexpected $end in E:\xampp\htdocs\announcements\announcement.php on line 143

第 143 行是 PHP 文件的最后一行。当我注释掉时

$htmlcode=<<<eod
<div>$question</div>
<div>$option1 $option2 $option3 $option4</div><br/>
eod;
echo $htmlcode;

错误消失了。怎么了?

最佳答案

eod;

后有空格

manual 中所述

It is very important to note that the line with the closing identifier must contain no other characters, except possibly a semicolon (;). That means especially that the identifier may not be indented, and there may not be any spaces or tabs before or after the semicolon. It's also important to realize that the first character before the closing identifier must be a newline as defined by the local operating system. This is \n on UNIX systems, including Mac OS X. The closing delimiter (possibly followed by a semicolon) must also be followed by a newline.

关于php - 解析错误 : syntax error, 意外的 $end in E :\xampp\htdocs\announcements\announcement. php on line 143,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1807391/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com