在 PHP 中回显这一行时出现问题
我无法回应这句话。有人愿意帮忙吗?
echo '<li><a href="http://stackoverflow.com/thread-'.$row->tid.'-1-1.html'">'.$row->subject.'</a></li>';
I am having trouble echoing this line. Is anyone willing to help?
echo '<li><a href="http://stackoverflow.com/thread-'.$row->tid.'-1-1.html'">'.$row->subject.'</a></li>';
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
由于您的字符串包含在 中单引号,您必须关闭引号,连接变量,然后重新打开引号:
(分成几行以提高可读性)
Else, you could use a [double-quoted][2] string, to have variables interpolation -- escaping the double-quotes that are inside the string :
As your string is enclosed in single-quotes, you have to close the quotes, concatenate the variables, and re-open the quotes :
(split over several lines to improve readability)
Else, you could use a [double-quoted][2] string, to have variables interpolation -- escaping the double-quotes that are inside the string :
您的报价不匹配。
Your quotes are mismatched.
您在这部分中间过多地回显了一个单引号:
'-1-1.html'">'
。该单引号当前正在关闭字符串,并将导致解析错误如果您的编辑器支持语法突出显示,您将能够注意到此引用后的颜色差异。
要解决此问题,请将代码更改为:
You are echoing one single quote too much in the middle of this part:
'-1-1.html'">'
. This single quote is currently closing the string and will result in a parse error.If your editor is supporting syntax highlighting, you will be able to notice a difference in colour after this quote.
To solve this problem, change this your code to:
像这样:
like this: