Solved

Apply Source Format

Posted on 2004-10-13
4
429 Views
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

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

after
if(something){
   Do this;
}else{
   Do this;
}

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

Expert Comment

by:Diablo84
ID: 12298525
Take a look at this class from pear:

http://pear.php.net/package/PHP_Beautifier/
0
 
LVL 27

Expert Comment

by:Diablo84
ID: 12298556
0
 
LVL 27

Expert Comment

by:Diablo84
ID: 12298655
There is a source code "beautifier" program here also, but this is not free: http://www.textrush.com/formatx.htm

It does however support a range of languages including php.

Shareware download: http://www.tucows.com/preview/355268.html
0
 
LVL 9

Accepted Solution

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

http://www.waterproof.fr/products/phpCodeBeautifier/

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

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 (http://en.wikipedia.org/wiki/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