mysql_set_charset()。
这个函数是这样用的:
mysql_set_charset('utf8', $link);
成功返回 TRUE,失败返回 FALSE。
就这么简单。
下面是PHP手册原文
This is the preferred way to change the charset. Using mysql_query() to execute SET NAMES .. is not recommended.
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn