コード例 #1
0
 function bestemmie_are_coming()
 {
     //$pattern='/[^\x{0009}\x{000a}\x{000d}\x{0020}-\x{D7FF}\x{E000}-\x{FFFD}]+/u';
     $pattern = '/[\\x00-\\x08\\x0B\\x0C\\x0E-\\x1F]/u';
     $content = file_get_contents($this->url);
     //elimino caratteri non utf-8
     $content = mb_convert_encoding($content, 'UTF-8', 'UTF-8');
     //elimino caratteri non stampabili
     $new = preg_replace($pattern, '', $content);
     $this->to_clean = time() . ".tmp";
     $pagina = fopen($this->to_clean, "w");
     fwrite($pagina, $new);
     fclose($pagina);
     $base = $_SERVER['SERVER_NAME'];
     $last = $_SERVER['PHP_SELF'];
     $last = parent::getInitialURL($last);
     parent::loadPage("http://" . $base . $last . $this->to_clean);
 }