我是 php 新手。不知道如何使用表达式。这是我网站搜索文件中的 php 代码。我想添加 html 标签,例如 href、div、li、ul 等。我该怎么做?
if(mysqli_num_rows($results) >= 1)
{
$output = "";
while($row = mysqli_fetch_array($results))
{
$output .= "Size: " . $row['fh_Vsize']. "<br />";
$output .= "Icon: <img src=" . $path .$row['fh_Sicon']. " alt=><br />";
$output .= "File ID: " . str_replace("_"," ",$row['fh_Sid']) . ""; $nbsp; $nbsp; $output .= "" . $row['fh_Vcaption'] . "<br />";
$output .= "Description: " . substr(strip_tags($row['fh_Sdescription']),0,150) . "<br />";
$output .= "Download: <a href=download_" . $row['fh_Sid'] . "/>Download</a><br /><br />";
}
echo $output;
}
else
echo "There was no matching record for the name " . $searchlink;
像这样的东西。我很抱歉这段代码。我是新来的,将学习基础知识:
<div class="info">
<h4><a href="'. $path .'download_'. en_string($rec['fh_Sid']) .'/">'.de_string($rec['fh_Sid']) .' ' .$rec['fh_Vcaption'] .' '. $rec['fh_Vextension']. '</a><span class="updated">updated</span></h4>
<div><img style="float:left;margin-right:5px" src="'. $path . str_replace("t_", "",$rec['fh_Sicon'] ).'"/></div><p>'. substr (strip_tags($rec['fh_Sdescription']),0,170) .' ...</p>
<ul class="prod-info">
<li class="none-separator">Last update: <strong>' . strftime("%d %b %Y", $rec['fh_Vdate']) . '</strong></li>
<li>License: <a href="freeware_pop.html" title="'. $rec['fh_Vlicense'] . '">'. $rec['fh_Vlicense'] . '</a></li>
<li>Size: <strong>'.$rec['fh_Vsize'].'</strong></li>
<li>Downloads: <strong>'. $views[$sid] .'</strong></li>
<li><img src="../../images/dl.png"/> <a href="'.$path.'download_'.$rec['fh_Sid'].'/">Download</a></li>
</ul>
</div>