<;br/>&书信电报;b>;解析错误</b>;:语法错误,意外的$end in<;b>;E:\xampp\htdocs\online\viewshistory.php</b>;在线<;b>;43</b>&书信电报;br/>;
下面是viewshistory.php的代码<;br/>&书信电报;b>;解析错误</b>;:语法错误,意外的$end in<;b>;E:\xampp\htdocs\online\viewshistory.php</b>;在线<;b>;43</b>&书信电报;br/>;,php,debugging,Php,Debugging,下面是viewshistory.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 (!empt
<?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;
?>
然而,我得到了一个错误
分析错误:语法错误,意外的$end in
E:\xampp\htdocs\online\viewshistory.php
第43行当我运行它时。怎么了?是否缺少半个括号?但似乎所有括号都是成对的。在
htm之后有尾随空格代码>在第43行。删除它,解析错误就会消失
此外,看起来您正在尝试使用+=
运算符连接在htm
herdoc中创建的字符串。可能应该改为=
在htm之后有尾随空格代码>在第43行。删除它,解析错误就会消失
此外,看起来您正在尝试使用+=
运算符连接在htm
herdoc中创建的字符串。这可能应该更改为=
我不认为这是问题所在,但$item+=我不认为这是问题所在,但$item+=+1--您是否将其粘贴到TextMate中以查找它?我就是这样找到的,只是打得不够快。在=
上有很好的捕捉@道格·内纳:事实上,如果你能相信的话,我把它粘贴到了vim中。Vim没有对heredoc的结尾进行颜色编码,所以我知道有问题。+1--您是否将其粘贴到TextMate中以查找它?我就是这样找到的,只是打得不够快。在=
上有很好的捕捉@道格·内纳:事实上,如果你能相信的话,我把它粘贴到了vim中。Vim没有对heredoc的末尾进行颜色编码,所以我知道有问题。这个问题在@asah的帮助下得到了解决。这个问题在@asah的帮助下得到了解决。
<br />
<b>Parse error</b>: syntax error, unexpected $end in