In the character interception is often due to HTML format unexpectedly, ASP is, PHP (as the mainstream development language now) Also, if the simple HTML format is predictable with replace on the line, for the body of the article may contain all the HTML format, want to efficient point or use the following, has been tested
$search = Array ("' Si",//Remove JavaScript
"' <[/!] *? [^<>]*?> ' Si ',//Remove HTML tags
"' ([RN]) [s]+ '",//Remove whitespace 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 (as the current mainstream development language) code
$replace = Array ("",
"",
"1",
""",
"&",
"<",
">",
" ",
Chr (161),
Chr (162),
Chr (163),
Chr (169),
"Chr (1)");
$document for a string to be processed if the source is a file can $document = file_get_contents ($filename);
$text = Preg_replace ($search, $replace, $document);
http://www.bkjia.com/PHPjc/509162.html www.bkjia.com true http://www.bkjia.com/PHPjc/509162.html techarticle in the character interception is often due to HTML format unexpectedly, ASP is, PHP (as the mainstream development language now) Also, if it is predictable simple HTML format with replace on the line, for the article ...