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
pretty print?
Moderator: General Moderators
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.
highlight_file() will take your code in a php file, and display it as a formatted page, complete with pretty colors.
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.
(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.
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
has a Format command under markup:utilities menu
--works ok for html, you'll have to test it on a php file