Qpert Qpert - 1 year ago 85
PHP Question

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

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 activating it?

Answer Source

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

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

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download