Garbled is a very big problem for beginners of PHP, now summed up the cause of garbled and solution:
HTML page encoding:meta Http-equiv=content-type content=text/html; Charset=utf-8 coding here and database coding, and connecting the database coding;
Second, the file in the storage code: such as file inde.php, change its storage code for the required encoding. Simply save it as a editplus text editing software file, select the correct encoding in the code (which many people will ignore);
third, the database code: For example, with the phpMyAdmin Select the database, select the action option. Here is a collation, which should also be set into a unified code;
Four, table code: operation and 3rd similar. There is no repetition here;
Five, Field coding: in the construction of the table in the field, there is a collation. If the content has Chinese characters, it must be changed into a unified code;
mysql_select_db () After the connection to the database (), add a sentence mysql_query (set names UTF8);
Seven, (just encountered) local test after the successful website, uploaded to the Internet, there will be garbled. It is possible to export the data locally without selecting the correct encoding, so there is a garbled problem after importing to the Web.
In fact, as long as the careful point, you can completely solve the problem of PHP garbled, difficult is not technology, but careful.