I just installed HTML tidy using the following command line:
sudo apt-get install php5-tidy
yet I have no idea how to use it because I thought it is an auto process that can do things by itself after all.
I found this little piece of code instructing how to use, but not sure where to put the code!!
The code is:
$config = array( 'indent' => true, 'output-xhtml' => true, 'show-body-only' => true, 'wrap' => 0); $tidy = new tidy; $tidy->parseString($html_txt, $config, 'utf8'); $tidy->cleanRepair(); echo $tidy;
I found this info on this link: Use HTML Tidy with PHP5 under Ubuntu/Debian
My purpose is to tidy both HTML and PHP files on my Ngninx server. I tried some Nginx Modules such as Mod_strip, but didn't work for me...!!
any idea how to use above code and where??