View Single Post
  #2 (permalink)  
Old 17-09-2007, 14:05
mephisto's Avatar
mephisto mephisto is offline
Senior Member
 
Join Date: Feb 2007
Location: Darlington
Posts: 101
Send a message via ICQ to mephisto Send a message via MSN to mephisto
Default

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
?>
Reply With Quote