what function does PHP have to convert the HTML entity symbol é to é?
PHP that several functions have tried, no AH.
Reply to discussion (solution)
I don't know how you do it.
Let me give you a list of HTML entities supported by PHP
foreach (Get_html_translation_table (html_entities) as $k = = $v) {
Echo Ord ($k). ' = '. $v. Php_eol;
}
And then you can do it yourself.
Agree upstairs
It seems to support this symbol, weak weak question, which function should be used to convert?
I don't know how you do it.
Let me give you a list of HTML entities supported by PHP
foreach (Get_html_translation_table (html_entities) as $k = = $v) {
Echo Ord ($k). ' = '. $v. Php_eol;
}
And then you can do it yourself.
Echomb_convert_encoding ("é", "UTF-8", "html-entities"); E
Very good, then ask, if an article has a lot of such characters need to convert it? Can not be a change, there is no easier way?
PHP Code
Echo mb_convert_encoding ("é", "UTF-8", "html-entities");
E
Do you want to do this?
foreach (Get_html_translation_table (html_entities) as $k = = $v) {
$str = Str_replace ($v, mb_convert_encoding ($v, "GBK", "html-entities"), $STR);
}
Very good, then ask, if an article has a lot of such characters need to convert it? Can not be a change, there is no easier way? Reference to the 4 floor of the reply:
PHP Code
Echo mb_convert_encoding ("é", "UTF-8", "html-entities");
E
Html_entity_decode
$text = mb_convert_encoding ($text, "UTF-8", "html-entities");
You're still a cow. Solve the problems that have plagued me for a long time. I can sleep tonight.
$text = mb_convert_encoding ($text, "UTF-8", "html-entities");
Still have a problem ah, those characters are turned clean. But ordinary characters such as spaces are not.
Like what
$str = ' class ' √ ';
$str = mb_convert_encoding ($str, "GBK", "html-entities");
Echo $str;
$text = mb_convert_encoding ($text, "UTF-8", "html-entities");
Html_entity_decode (' é ');