Php conversion html special characters I wrote function conversion some special characters functionformat_html ($ str) {$ strstr_replace (& amp; ldquo;, ", $ str); $ strstr_replace (& amp; rdquo;, ", $ str); $ strstr_replace (& amp; middo php converts html special characters
Function I wrote
// 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;
}
However, there are too many symbols. About 255 online users. How can this problem be solved?
------ Solution --------------------
... You don't need to convert it like this. "When the webpage does not recognize the html language, this symbol will be displayed. if the page is full html,"
------ Solution --------------------
PHP code
Htmlspecialchars: $ htm ="AB c
"; Echo htmlspecialchars ($ htm); # Source code # <p> AB c </p> # Page #AB c