Does anyone know how can I default web browser character encoding in php, which I hope all user drop in to the page with using character encoding western (ISO-8859-1)
A:
You can set the character encoding by outputting the Content-Type header.
header('Content-Type: text/html; charset=ISO-8859-1');
This will tell the browser to use this character set to read your pages.
thephpdeveloper
2009-11-25 23:22:40
+1
A:
Before printing/echoing anything else do this
header('Content-Type: text/html; charset=ISO-8859-1');
This will change HTTP headers and will set the browser's default encoding to ISO-8859-1 for your page, unless the user specifies otherwise via browser's settings.
klez
2009-11-25 23:24:54