How to display PHP & HTML source code on a page?

后端 未结 8 2100
悲&欢浪女
悲&欢浪女 2020-11-30 14:20

How would one go about showing PHP code on user end. Sort of like w3School does?

Having lets say a grey area div, and then showing the code in there without activati

8条回答
  •  暖寄归人
    2020-11-30 14:56

    You can use html entities <?php in the html it will be rendered as

    You can use htmlspecialchars to encode your code to use html entities.

提交回复
热议问题