I am trying to recreate a string but I am having issues with the utf-8 encoding (I guess?)
I am using the code below to format a string
$pre_subject = (strip_tags(html_entity_decode($temp_subject)));
$pre_subject = str_replace('Â', '', $pre_subject);
$pre_subject = iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $pre_subject);
The problem is that instead of getting the result as in the 1st sentence below, I get a result as the second one.
1st. summary: SHANGHAI room - Réunion
2nd. summary: SHANGHAI room - R'eunion
I need to keep the format as the first example, how can I modify my code for that?
Make you PHP header like:
also, when dealing with utf-8, if you need to do string replace use mb_str_replace and not str_replace
The string has UTF-8 characters. You need to either decode them, or tell whatever is reading it to use UTF-8 encoding.
So, this:
Or add this to
<head>
: