【发布时间】:2019-01-10 09:18:05
【问题描述】:
好吧,在一个 .php 文件中,我为每个结果(来自搜索输入)回显一些 html(如模板):
while ($row = mysqli_fetch_array($result))
{
//image
echo "<img id=" . '"' . "myImg" . '"' . "src=" . '"' . "showImage.php?image=" . $row['shortcutImage'] . '"' . "class=" . '"' . "imageList" .'"' . ">";
//title
echo "<h5 class=" . '"' ."titleResult" . '"' . ">". $row['name_now'] . "</h5>";
//area
echo "<p class=" . '"'. "areaResult" . '"' . ">" . "Περιοχή: " . $row['area'] . "</p>";
//break between results
echo "<br>";
echo "<br>";
}
风格
-
imageList用于图片 -
titleResult用于<h5> -
areaResult为<p>
【问题讨论】: