string mysql_client_encoding([resource $res])
(PHP 4 ⇒ 4.3.0, PHP 5)
| $res | The database connection resource that we want to modify. |
|---|---|
| RETURNS | The name of the character set encoding used by the MySQL database. |
This function returns the name of the character set encoding used by the MySQL database server. Make sure you have established a connection to the database using mysql_connect before calling this function.
// open the mysql resource $res = mysql_connect($server, $user, $pass); // retrieve the mysql character encoding $charset = mysql_client_encoding($res); echo 'MySQL charset is ' . $charset;