Results 1 to 5 of 5

Thread: Display source rather than print it

  1. #1
    Join Date
    Jan 2006
    Location
    Ft. Smith, AR
    Posts
    795
    Thanks
    57
    Thanked 129 Times in 116 Posts

    Default Display source rather than print it

    Not sure if this is in the right place, if not you can move it to wherever you feel like it should be...

    Does anyone know how to display the different syntaxes of programming languages on an html document? Like, let's say I want something like this:

    Code:
    <html>
    <head />
    <body>
    <?php 
    echo("HI");
    ?>
    </body>
    </html>
    How can I get the codes to show up and not print to screen?
    --------------------------------------------------
    Reviews, Interviews, Tutorials, and STUFF
    --------------------------------------------------
    Home of the SexyBookmarks WordPress plugin

  2. #2
    Join Date
    Oct 2006
    Posts
    183
    Thanks
    0
    Thanked 11 Times in 11 Posts

    Default

    Code:
    &lt;html&gt;
    &lt;head /&gt;
    &lt;body&gt;
    &lt;?php 
    echo("HI");
    ?&gt;
    &lt;/body&gt;
    &lt;/html&gt;
    To do this quickly just run it through htmlentites() php function

  3. The Following User Says Thank You to motormichael12 For This Useful Post:

    TheJoshMan (07-28-2008)

  4. #3
    Join Date
    Jan 2006
    Location
    Ft. Smith, AR
    Posts
    795
    Thanks
    57
    Thanked 129 Times in 116 Posts

    Default

    I really don't want to have to type out each character individually, but i'm not that great at php... How would I go about running it through that function?
    --------------------------------------------------
    Reviews, Interviews, Tutorials, and STUFF
    --------------------------------------------------
    Home of the SexyBookmarks WordPress plugin

  5. #4
    Join Date
    Oct 2006
    Posts
    183
    Thanks
    0
    Thanked 11 Times in 11 Posts

    Default

    http://www.w3clubs.com/htmlentities.php

    Does it for you

    If this helps can you thank me? that way I finally have a thank

  6. The Following User Says Thank You to motormichael12 For This Useful Post:

    TheJoshMan (07-28-2008)

  7. #5
    Join Date
    Jan 2006
    Location
    Ft. Smith, AR
    Posts
    795
    Thanks
    57
    Thanked 129 Times in 116 Posts

    Default

    EXACTLY what I was looking for!

    Thank you very much! I really appreciate it.
    --------------------------------------------------
    Reviews, Interviews, Tutorials, and STUFF
    --------------------------------------------------
    Home of the SexyBookmarks WordPress plugin

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •