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

后端 未结 8 2099
悲&欢浪女
悲&欢浪女 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 15:18

    You can use this template........

    ######################################################################
    echo "


    Source Code of ".basename((string)__FILE__) . "


    "; show_source(__FILE__); echo "
    "; echo "

    Output of ".basename((string)__FILE__) . "

    "; #######################################################################

    It will show the source code and output following.

提交回复
热议问题