Don't know how php free template works, but if you can capture the output, then you would be able to pass it through tidy and then run a regular expression to remove the new lines in the code.
PHP Code:
<?php
$output = // code to get output
$tidy = new tidy();
$output = $tidy->repairString($output, array (
"add-xml-decl" => true,
"indent" => true,
"vertical-space" => false,
"indent-spaces" => 0,
"output-xhtml" => true,
"output-encoding" => "utf8",
"tidy-mark" => false,
"DocType" => "-//W3C//DTD XHTML 1.1//EN",
"merge-divs" => false,
"wrap" => 0,
"accessibility-check" => 3,
"output-bom" => false
));
$output = preg_replace("/\r?\n/m", "", $output);
// display the output
echo $output;
exit;w
?>