HTMLPurifier 4.4.0
|
00001 <? 00002 00003 00004 error_reporting(E_ALL);ini_set('display_errors', 1); 00005 00006 include('/home/ezyang/Desktop/simplehtmldom/simple_html_dom.php'); 00007 include('library/HTMLPurifier.auto.php'); 00008 00009 $html = file_get_html('http://www.lottolore.com/lotto649.html'); 00010 00011 00012 00013 foreach($html->find('table[cellpadding=2]') as $e) 00014 { 00015 for ($i=0; $i < sizeof($e->innertext); $i++) 00016 { 00017 $test[$i]= $e->innertext; 00018 00019 $a = htmlentities($e->innertext); 00020 00021 00022 00023 $jim=preg_replace("/<([a-z][a-z0-9]*)[^>]*?(\/?)>/i",'<$1$2>', $a); 00024 00025 $purifier= new HTMLPurifier(); 00026 $clean_html = $purifier->purify ($jim); 00027 echo $clean_html; 00028 00029 } 00030 00031 } 00032 00033 00034 00035 ?> 00036