I recently discovered PHP_Beautifier http://pear.php.net/package/PHP_Beautifier/ in a Digg post.

I've spent a good chunk of my morning trying to figure out how to set it up/use it [with no success]!
I can't find any tutorials anywhere for it, can anyone shed some light on the matter 🙂

Thanks for reading.

    I'm not sure why would you even need this program anyway, unless you do some contract work and are trying to impress the client?

      I work with several people... each with their own coding styles [some better than others lol]. This would provide a quick and easy way to get all the code into the same format.

        For anyone who is interested... I have figured it out.

        To install run in the command line:

        sudo pear install channel://pear.php.net/PHP_Beautifier-0.1.13

        Then very basic usage is:

        require "PHP/Beautifier.php";
        $oBeaut= new PHP_Beautifier();
        $oBeaut->setInputFile('messy.php');
        $oBeaut->setOutputFile('beautified.php');
        $oBeaut->process();
        $oBeaut->save();

        See the documentation on their site for more advanced useage.

        Hope someone finds this useful!🙂

          Thanks for following up with your solution.

            Write a Reply...