Output
suggest change- If your application transmits text to other systems, they will also need to be informed of the character encoding. In PHP, you can use the
default_charset
option inphp.ini
, or manually issue theContent-Type
MIME header yourself. This is the preferred method when targeting modern browsers.
header('Content-Type: text/html; charset=utf-8');
- If you are unable to set the response headers, then you can also set the encoding in an HTML document with HTML metadata.
- HTML5
<meta charset="utf-8">
- Older versions of HTML
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents