Cllean up so there is no HTML and only plain text. Is that not what the demo did as well?by teddy134 - Support
I need to first retrieve the code from another website. The code comes back jumbled up with a bunch of HTML tags within what I need. I then do some more cleaning within the php to get rid of data I don't require. HTML purifier was supposed to just clean out the HTML code that I have fetched so it becomes readable. Do you have some suggestions regarding what I just said? Do you think the problem liby teddy134 - Support
Yes I did not catch that, thanks. Fixed it but still not working, give this a go if you can. <? error_reporting(E_ALL);ini_set('display_errors', 1); include('simple_html_dom.php'); include('/Users/teddy/Desktop/htmlpurifier-4-1.3.0-lite/library/HTMLPurifier.auto.php'); $html = file_get_html('http://www.lottolore.com/lotto649.html'); foreach($html->find('table') as $e) { forby teddy134 - Support
<? error_reporting(E_ALL);ini_set('display_errors', 1); include('simple_html_dom.php'); include('/Users/teddy/Desktop/htmlpurifier-4-1.3.0-lite/library/HTMLPurifier.auto.php'); $html = file_get_html('http://www.lottolore.com/lotto649.html'); foreach($html->find('table') as $e) { for ($i=0; $i < sizeof($e->innertext); $i++) { $test[$i]= $e->innertext; $a = htby teddy134 - Support
No for some reason I removed it and did not return it after I was done meddling with it trying to get it to work. I added it and now NOTHING is coming up in the web browser when I echo $clean_html. I even did an error report at the very top, nothing comes up as well as put it in different places in the code (though I think global declaration would have been good enough). Any other suggestions?by teddy134 - Support
I have not done that line. I thought it was declared with $clean_html = $purifier->purify ( $man); What needs to go after $purifier =. ? I have posted my code exactly as it is in the .php file, I have not changed it for any reason. I assume my problem lies in the $Purifier declaration you mentioned.by teddy134 - Support
If you look at my prior post with the real complete code, you will see it is defined there. Example from my code: //some code before $test[$i]= $e->innertext; $a = htmlentities($e->innertext); $file= file_get_contents($a); $man=preg_replace("/<(*)[^>]*?(\/?)>/i",'<$1$2>', $a); } } $clean_html = $purifier->purify ( $man); //here the purifier object is defined echby teddy134 - Support
<tr align="center"> <td colspan="5"><font size="4"><a name="past"><b>Past <font color="#FF0000">Lotto 6/49</font> Winning Numbers</a></b></font></td> </tr> <tr align="center"> <td><a href="lotto649.html"><b>Latest</b></a></td> <td><a href="l6490811.html"><b>Aug 11&lby teddy134 - Support
the same as if i echoed $man on its own... it displays but like i said, it doesn't clean it like i hoped.by teddy134 - Support
Ugh sorry my mistake i am modifying code on the fly to try and make it work. Here is the whole REAL thing: include('simple_html_dom.php'); include('/Users/teddy/Desktop/htmlpurifier-4-1.3.0-lite/library/HTMLPurifier.auto.php'); $html = file_get_html('http://www.lottolore.com/lotto649.html'); foreach($html->find('table') as $e) { for ($i=0; $i < sizeof($e->innertext); $i++) { $teby teddy134 - Support
Sorry I didnt include what I already posted first time around... This is the code when everything worked (though it does work even with html purifier, it just isnt cleaned). Here is the whole thing: include('simple_html_dom.php'); include('/Users/teddy/Desktop/htmlpurifier-4-1.3.0-lite/library/HTMLPurifier.auto.php'); $html = file_get_html('http://www.lottolore.com/lotto649.html'); foreach($by teddy134 - Support
include('simple_html_dom.php'); include('/Users/teddy/Desktop/htmlpurifier-4-1.3.0-lite/library/HTMLPurifier.auto.php'); $html = file_get_html('http://www.lottolore.com/lotto649.html'); foreach($html->find('table') as $e) { for ($i=0; $i < sizeof($e->innertext); $i++) { $test[$i]= $e->innertext; $a = htmlentities($e->innertext); $file= file_get_contents($a);by teddy134 - Support
Hey, I tried the demo of html purifier and it was exactly what I needed. I copied the text that was displayed in my web browser (it is a bunch of data mixed in with html tags, that is all on the web page) and I put it in the demo. It came out clean just like I needed it. I then got the lite version and followed all the instructions, got no errors with libraries but when i echoed it to the browseby teddy134 - Support