Apply Source Format

Posted on 2004-10-13
Last Modified: 2008-03-10
I have been looking all of the internet, for a program that will format php code into the right standard. IE

if(something){dothis;}else{do this;}

   Do this;
   Do this;

Macromedia's Dreamweaver has this option but its only for html code. I doens't touch the php.
Any Ideas??
Question by:ocsurf
  • 3
LVL 27

Expert Comment

ID: 12298525
Take a look at this class from pear:
LVL 27

Expert Comment

ID: 12298556
LVL 27

Expert Comment

ID: 12298655
There is a source code "beautifier" program here also, but this is not free:

It does however support a range of languages including php.

Shareware download:

Accepted Solution

_GeG_ earned 500 total points
ID: 12306022
and another one, i think it is free:

afaik you can customize the output, ie wether you want the opening { in the same line or on the next,...

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit ( and similar technologies have enjoyed wide adoption, making it possib…
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now