Copy Code code as follows:
<?php
$search = Array ("' <script[^>]*?>.*?</script> ' si",//Remove JavaScript
"' <style[^>]*?>.*?</style> ' si",//Remove CSS
"' <[/!] *? [^<>]*?> ' Si ',//Remove HTML tags
"' <!--[/!] *? [^<>]*?> ' Si ',//Remove comment mark
"' ([RN]) [s]+ '],//remove white space characters
"' & (quot| #34); ' I ",//Replace HTML entity
"' & (amp| #38); ' I ",
"' & (lt| #60); ' I ",
"' & (gt| #62); ' I ",
"' & (nbsp| #160); ' I ",
"' & (iexcl| #161); ' I ",
"' & (cent| #162); ' I ",
"' & (pound| #163); ' I ",
"' & (copy| #169); ' I ",
"' &# (d+); ' E "); Run as PHP code
$replace = Array ("",
"",
"",
"",
"\1",
"\"",
"&",
"<",
">",
" ",
Chr (161),
Chr (162),
Chr (163),
Chr (169),
"Chr (\1)");
$document for strings to be processed if the source is a file can $document = file_get_contents (' http://www.sina.com.cn ');
$out = Preg_replace ($search, $replace, $document);
Echo $out;
?>
Save as get.php can be.