解析错误:语法错误,E:\xampp\htdocs\online\viewhistory >中的意外$end。php在线43。
16lz
2021-01-22
Below is the code of viewhistory.php.
下面是viewhistory.php的代码。
<?php
foreach($_POST as $value){
if (empty($value))
{ echo 1;
exit();
}
}
//come code;
//SQL query;
while($row=mysql_fetch_assoc($result))
{
//some code;
if (!empty($reference))
{
$referencetxt=<<<html
| Referenced Solution ID:$reference
html;
}
else {
$referencetxt=" ";
}
$item+=<<<htm
<hr>
<span>Solution ID:$productid $referencetxt</span>
<xmp>$text</xmp>
<img src=$imagepath />
<div align="right">$username $moment</div>
htm;
}
echo $item;
?>
However, I get an error
但是,我有一个错误。
<br /> <b>Parse error</b>: syntax error, unexpected $end in
E:\xampp\htdocs\online\viewhistory.php on line 43
E:\ xampp \根\ \ viewhistory在线。php在43行
when I run it. What is wrong? Is a half bracket missing? But It seems all brackets are paired.
当我运行它。是什么错了吗?半括号不见了吗?但是似乎所有的括号都是成对的。
2 个解决方案
#1
4
You've got trailing whitespace after htm;
on line 43. Remove it and the parse error will go away.
在htm之后,你有尾随空格;43行上。删除它,解析错误就会消失。
Also, It looks like you're trying to concatenate the string created in the htm
heredoc using the +=
operator. That should probably be changed to .=
.
而且,看起来您试图使用+=操作符将在htm中创建的字符串连接起来。那应该改成。=。
更多相关文章
- PHP实现接口方法时出现致命错误
- JSON解析错误:无法识别的标记'<'处于角度
- 在提交注册表单时使用jQuery显示错误
- 获取所有网站的错误,[重复]
- 如何让jQuery ajax执行错误功能
- Yii 访问 Gii(脚手架)时出现 403 错误
- PHP强大包括处理错误?
- 您是否认为PHP中的错误形式是在类方法中访问超级全局变量?
- 解析错误:语法错误,第12行/home/public_html/gigs.html中的意外T_L