PHP Articles

  • The Observer Pattern


    Sunday, September 25, 2011

    The observer pattern is a simple, powerful design pattern that can be used in a variety of ways. This article looks at a simple implementation of it, and a few examples.

  • Translating text that contains HTML


    Thursday, September 22, 2011

    A recursive PHP function for iterating through the DOM elements of a chunk of HTML, and applying a user-defined translate function to the text elements.

  • Object Collections in PHP


    Saturday, September 17, 2011

    A PHP Collection class for storing an array of objects, iterating over them, sorting, and retrieving/deleting by object properties. Improves upon PHP's built in array support and ArrayIterator class.

  • Minifying CSS and Javascript on the Fly


    Friday, September 16, 2011

    Speed up your website by combining all your CSS and Javascript includes into single, minimized files while retaining the source code for development purposes.

  • wtf()


    Thursday, September 15, 2011

    A PHP function for debugging large, deeply nested objects. Kinda like wrapping the output of print_r() in <pre> tags, but sooooo much kewler.