Tuesday, June 7, 2016

How to remove symbol � ? PHP Include and accents (They show up as �)

That happens if the browser thinks your using another encoding than you actually use.
try to add the following in your php file before any html is printed:

header ('Content-type: text/html; charset=utf-8');
// or
header ('Content-type: text/html; charset=iso8859-15');

and add

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<!-- or -->
<meta http-equiv="Content-Type" content="text/html; charset=ISO8859-15" />

between the <head></head> tags

UPDATE: just saw your update with the file. you need to add header ('Content-type: text/html; charset=utf-8');

No comments:

Post a Comment