这是我的带有 php 脚本的 html:
<html> <head> <title>Bob's Auto Parts</title> </head> <body> <h1>Bob's Auto Parts</h1> <table width = 100% > <tr> <?php echo "<td>This is working.</td>"; ?> </tr> </table> </body> </html>
为什么 this 的输出带有 ; ?>。我希望它是“这行得通”。只要。这是输出
Bob's Auto Parts
Bob's Auto Parts
This is working."; ?>
我知道我在这里做错了,但无法弄清楚。提前致谢。
最佳答案
确保您使用的是 <?php
而不是 <?
速记,因为这可能在您的服务器上被禁用。这将导致 "; ?> 的输出,就像几个月前我在过渡到 PHP5 时发生的那样。
当 PHP 解析器没有将其检测为 PHP 时,我只看到过这样的奇怪输出。确保检查 PHP 是否按预期运行并且 <?php
正在识别标签。
关于php - 简单的 PHP 回显代码不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7639271/