Php: Conversion of special html characters I wrote FUNCTIONS // conversion of some special characters functionformat_html ($ str) {$ str = str_replace ('& amp; ldquo;', ', $ str); $ str = str_replac 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 # AB c # Page # AB c