PHP Conversion HTML Special symbols
I wrote the function
Convert some special characters
function format_html ($STR) {
$str = Str_replace (' "', '" ', $str);
$str = Str_replace (' "', '" ', $str);
$str = str_replace (' • ', ' • ', $str);
$str = Str_replace (' ', ' ', $str);
$str = Str_replace (' ', ' ', $str);
$str = Str_replace (' ... ', ' ... ', $str);
$str = Str_replace ('-', '-', $str);
return $str;
}
But these symbols are too many. Online, about 255. So much, how is it possible to turn the end, there is no way?
------Solution--------------------
.... You don't have to do this. "This symbol is displayed when the page does not recognize the HTML language. If the page is full HTML then it is"
------Solution--------------------
PHP Code
Htmlspecialchars: $htm = "AB C"; Echo Htmlspecialchars ($htm); #源码 #<div>ab c</div> #页面 #ab C