The mysql_client_encoding() function is used to find the default character set name for the current connection.
PHP mysql_client_encoding() Function Example:
The mysql_client_encoding() function is used to find the default character set name for the current connection.
Example:
<?php
$connection = mysql_connect("localhost","root","root");
if (!$connection) {
die('PHP Mysql database connection could not connect : ' . mysql_error());
}
else{
$charactor_set = mysql_client_encoding($connection);
echo "The current character set is: $charactor_set\n";
}
mysql_close($connection);
?>
After running this example the output is:
Output:
The current character set is: latin1

[ 0 ] Comments