When you look at the source code of PHP generated output usually everything is on one line, it makes it very hard for front end developers to read the code and trouble shoot.
For more or less clean looking PHP generated code I used "
signs for the echo
output Strings, wich enables you to use \n
and \t
or other codes like that to make new Lines or Code indentation.
If you need "
signs in your output you need to escape them with \"
. this will output a "
but PHP will treat it like a usual character.
I know it is a pain getting a beautiful code this way but at least it makes it readable.
You could use the tidy PECL extension - see this related question for examples.