(PHP 5 >= 5.1.0RC1)
mysqli_set_charset(no version information, might be only in CVS)
mysqli->set_charset -- Sets the default client character setProcedural style:
bool mysqli_set_charset ( mysqli link, string charset )Object oriented style (method):
class mysqli {Sets the default character set to be used when sending data from and to the database server.
link
Procedural style only: A link identifier returned by mysqli_connect() or mysqli_init()
charset
The charset to be set as default.
Note: To use this function on a Windows platform you need MySQL client library version 4.1.11 or above (for MySQL 5.0 you need 5.0.6 or above). It can be downloaded at http://dev.mysql.com/downloads/connector/php/.
Example 2. Procedural style
|
The above example will output:
Current character set: utf8 |