Php 如何在浏览器中将Html代码转换为模板输出
我需要在模板中转换HTML。 如图所示,内容应显示为模板。 我用桌子来展示。但现在我需要在模板输出中显示它 这是我的密码:Php 如何在浏览器中将Html代码转换为模板输出,php,jquery,html,Php,Jquery,Html,我需要在模板中转换HTML。 如图所示,内容应显示为模板。 我用桌子来展示。但现在我需要在模板输出中显示它 这是我的密码: <table id="datatable" class="tablesorter"> <span id='errfrmMsg'></span> <thead> <tr> <th scope="col" id="">Name<
<table id="datatable" class="tablesorter">
<span id='errfrmMsg'></span>
<thead>
<tr>
<th scope="col" id="">Name</th>
<th scope="col" id="">Content</th>
</tr>
</thead>
<tbody>
<?php
$templ_id = $_REQUEST['templ_id'];
$getTemplateQuery = mysql_query("select * from templates where id = $templ_id");
$getTemplateRow = mysql_fetch_array($getTemplateQuery);
?>
<tr>
<td valign="top" width="125"><?php echo $getTemplateRow['templ_name'];?></td>
<td valign="top" width="319">
<?php
echo $templContent = $getTemplateRow['templ_content'];
?>
</tr>
</tbody>
</table>
以下是一个输出:
根据我从您的问题中收集到的信息,请尝试输出: $html=htmlspecialchars\u解码$content 编辑:
echo$TempleContent=htmlspecialchars_decode$getTemplateRow['templ_content'] 试试这个这对你有帮助
<?php
echo $htmlContent = htmlspecialchars_decode($getTemplateRow['templ_content'])
?>
你把html内容放在div或textarea中的什么地方。在td或textarea中?你能添加一些PHP如何构建的代码吗?你的意思是希望html显示为一个真实的表,而不是源代码?你太神秘了。echo$htmlContent=htmlspecialchars\u decode$content人们对你投了反对票,因为你最初没有向我们提供任何代码,而且你的问题措辞很糟糕,所以我们的答案只是猜测。提供代码是使您想问的问题更清楚的最简单方法。