PHP Output Buffering (with HTML)

Over the past year I have made heavy use of PHP output buffering. Although it serves no function purpose, it can make for much more readable code; I have found it particlarly useful for outputting HTML from methods. Consider the following code example:

Netbeans ScreenShot

As you can see, using output buffering makes the html much easier to read (especially thanks to Netbeans code highlighting). With short examples, the difference is negligable, but when you have large amounts of html in a php method, using output buffering can make the code a lot more maintainable.

This entry was posted in Html, PHP, Uncategorized and tagged , , , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>