How to print code on HTML

前端 未结 7 1756
再見小時候
再見小時候 2020-12-03 21:17

I want to display code characters on an HTML page. But no matter what I try it always renders HTML characters. pre or code doesn\'t work. How can I

相关标签:
7条回答
  • 2020-12-03 22:06

    Since tag is now depreciated : https://developer.mozilla.org/en-US/docs/Web/HTML/Element/xmp

    You can use PHP to convert HTML tags :

    <code> <?php print htmlentities('<p>Blah</p>'); ?> </code>

    0 讨论(0)
提交回复
热议问题