Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我在 php 中有这段代码,它应该打印我的图像,但它不是。
这段代码有问题吗?谢谢!
echo "<td> <img src=foto/photo1/".$row['photo'] . " ></td>"; echo "<td> <img src=foto/photo2/".$row['photo2'] . "></td>";
您错过了回声中的 ' 标记。尝试这个:
echo '<td> <img src="foto/photo1/'.$row['photo'].'"></td>'; echo '<td> <img src="foto/photo2/'.$row['photo2'].'"></td>';
对图像 src 属性使用单引号'。
'
像这样更改您的代码
<img src='foto/photo1/".$row['photo'] ."'></td>