SitePoint Sponsor

User Tag List

Results 1 to 7 of 7

Thread: echo PHP code

  1. #1
    Wadge! F4nat1c's Avatar
    Join Date
    Oct 2005
    Location
    South Wales, UK
    Posts
    1,134
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    echo PHP code

    I've always wondered this. How do websites (such as PHP.net) echo PHP code onto the the screen without it being interpretated? Also, how do they add the syntax highlighting?
    OMFG SitePoint ROXORZ TEH BIG ONE111!
    Wish you were invisible?

  2. #2
    SitePoint Addict smittenbite's Avatar
    Join Date
    Jul 2005
    Location
    Friendswood
    Posts
    397
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well cant you just put it oustide of the
    PHP Code:
    <?php echo "you wont see code here"?> you see will this code: echo "you can see that i echo'd this";
    nothing.

  3. #3
    SitePoint Wizard mark_W's Avatar
    Join Date
    Mar 2004
    Location
    West Midlands, United Kingdom
    Posts
    2,631
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  4. #4
    SitePoint Wizard silver trophy Jelena's Avatar
    Join Date
    Feb 2005
    Location
    Universum, 3rd Corner
    Posts
    3,001
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    -- Jelena --

  5. #5
    SitePoint Wizard mark_W's Avatar
    Join Date
    Mar 2004
    Location
    West Midlands, United Kingdom
    Posts
    2,631
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

  6. #6
    SitePoint Addict yjanse's Avatar
    Join Date
    Apr 2004
    Location
    The Netherlands
    Posts
    240
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Now the three best ways to do it have been posted, here is the worst way to do it:

    1. Make a screenshot of the code when you are in your IDE.
    2. Enlarge the screenshot in an image editing application.
    3. Print it on a piece of t-shirt transferpaper.
    4. Iron the image of the code onto the t-shirt.
    5. Put the t-shirt on (pls don't mix the order of step 4 and 5!)
    6. Stand in front of a mirror and take a picture with an analog camera.
    7. Have the picture developed and enlarged to A4 or letter size.
    8. Scan the picture with a flatbed-scanner at 4800 dpi.
    9. Mirror the image so the code is readable.
    10. Save it as a 40MB bitmap image.
    11. Host it at a free image site with a lot of annoying banners.
    12. Use an iframe tag to insert the image from that site into your page.
    13. Done!

    Yves Janse:
    Android42.net - PHP5 Bookcase project - Developers Blog
    | PHP | MySQL | CSS | XML | XHTML | AJAX | Patterns |

  7. #7
    SitePoint Wizard bronze trophy Immerse's Avatar
    Join Date
    Mar 2006
    Location
    Netherlands
    Posts
    1,661
    Mentioned
    7 Post(s)
    Tagged
    1 Thread(s)
    Er, or Geshi!



    Quote Originally Posted by yjanse
    Now the three best ways to do it have been posted, here is the worst way to do it:

    1. Make a screenshot of the code when you are in your IDE.
    2. Enlarge the screenshot in an image editing application.
    3. Print it on a piece of t-shirt transferpaper.
    4. Iron the image of the code onto the t-shirt.
    5. Put the t-shirt on (pls don't mix the order of step 4 and 5!)
    6. Stand in front of a mirror and take a picture with an analog camera.
    7. Have the picture developed and enlarged to A4 or letter size.
    8. Scan the picture with a flatbed-scanner at 4800 dpi.
    9. Mirror the image so the code is readable.
    10. Save it as a 40MB bitmap image.
    11. Host it at a free image site with a lot of annoying banners.
    12. Use an iframe tag to insert the image from that site into your page.
    13. Done!

    You forgot the part about using the kitchen table to make a nice wooden frame for the photo


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
  •