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代码如下:
<?php echo "<tr></tr>"; //ouput I want : <tr></tr> ?>
当我想显示输出时<tr></tr>。但我不知道我应该使用这个功能,任何知道的人请帮助我,谢谢
<tr></tr>
试试htmlentities喜欢
htmlentities
<?php echo htmlentities("<tr></tr>"); ?>
按照这个链接
您还可以利用htmlentities()
htmlentities()
使用htmlentities
<?php echo htmlspecialchars('<tr></tr>'); ?>
尝试这个
$output = htmlspecialchars("<tr></tr>", ENT_QUOTES);