I was writing some code for repair html string. I read some nice solutions which work with the Tidy PHP class but I had some troubles with it. What in this post is written, is exactly what I want but I need to install / load the PHP Tidy class. Close tags from a truncated HTML string
I'm working on PHP 5.5.4
.
I tried to install tidy following some tutorials but nothing has append.
When I call the tidy class $tidi = new \tidy();
, NetBeans suggests me the class and clicking on it (Ctrl + click) I see it but refreshing the page I obtain the error Class 'tidy' not found in ... /myfile.php line ...
I used in the same way the class $myVar = new \DomDocument();
but it works perfectly.
Checking whether the Tidy extension is loaded like below, I get "NOT LOADED".
echo extension_loaded('tidy') ? "LOADED" : "NOT LOADED";
Please, can someone explain me how Tidy works and how can I set it up? My Ubuntu's version is 13.10.