SqlFormatter
Lightweight php class for formatting sql statements
.... The SqlFormatter class has a static method 'format' which takes a SQL string as input and returns a formatted HTML block inside a pre tag. If you don't want syntax highlighting and only want the indentations and line breaks, pass in false as the second parameter. There is a separate method 'highlight' that preserves all original whitespace and just adds syntax highlighting.