Display UTF8 encoding records such as Chinese or Asian languages from MySQL database with PHP
Editor’s note:Â If you are a programmer who involves with a database with UTF8 language encoding records such as Chinese or other Asian languages. You might counter some cases when you try to display the records, the UTF8 language characters might appear to be meaningless symbols. I have found a way to solve this issue.
Include the codes below in the beginning of the PHP file which the UTF8 encoding language records will be displayed from that file:
1 2 3 4 | <?php header("Content-Type: text/html; charset=utf-8"); mysql_query("SET NAMES UTF8"); ?> |
Similar Posts:
- Change the MySQL database table encoding to UTF8 with PHP
- Include a PHP file in another PHP file
- Copy one table’s field records into another table’s field in MySQL database with PHP
- Create check box by using the records from MySQL datebase as values
- Check how many record in the MySQL database matches the query





Add A Comment