• How to show raw PHP code on page

    HeatherKort Member

    I am trying to write a script that will output raw PHP onto a page without executing it.

    But to be having more problems than anticipated, any ideas?

    My page is in PHP, so for example, like this forum on this page viewtopic.php I could now write something like this

    
    

    and it shows you my code, doesn’t execute it

  • Amit Member

    Same thing, except instead of executing it, wrap it in a string:

    
    

    This yields:

    
        
  • SapnaVishwas Member

    More easier way to handle this would be to do

    echo htmlentities($yourCode);
    
Viewing 2 reply threads
  • You must be logged in to reply to this topic.
en_USEnglish