pretty print?

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
psychomachine
Forum Newbie
Posts: 17
Joined: Wed Mar 03, 2004 1:18 pm

pretty print?

Post by psychomachine »

Hi,

I was wondering if there are any macintosh or cross-platform utilities out there that could go through a php file which has no tabs, indents etc... and "pretty print" it for you, i.e. make it easier to read.

I have only recently started learning php and as my scripts are getting longer and longer, I am beginning to lose the overview.

all best,

pschmchn
Roja
Tutorials Group
Posts: 2692
Joined: Sun Jan 04, 2004 10:30 pm

Post by Roja »

Not surprisingly, I would suggest using php to format your php.

highlight_file() will take your code in a php file, and display it as a formatted page, complete with pretty colors. :)
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Post by McGruff »

If you are "losing the overview" two things might help.

(1) Remove all html into .htm template files. Include these to print a page, after you have defined the page vars in php. See the theory and design forum, "bad practice" and various other topics re templating.

(2) Organise your code into functions. Fns should be brief, carrying out just one task. Six or seven lines is a nice size.
User avatar
xisle
Forum Contributor
Posts: 249
Joined: Wed Jun 25, 2003 1:53 pm

Post by xisle »

BBedit (http://www.barebones.com)
has a Format command under markup:utilities menu
--works ok for html, you'll have to test it on a php file
psychomachine
Forum Newbie
Posts: 17
Joined: Wed Mar 03, 2004 1:18 pm

Post by psychomachine »

thanks, guys!
Post Reply