array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'pt_BR', ), 'this' => array ( 0 => 'function.mysql-client-encoding.php', 1 => 'mysql_client_encoding', ), 'up' => array ( 0 => 'ref.mysql.php', 1 => 'Funções da MySQL', ), 'prev' => array ( 0 => 'function.mysql-affected-rows.php', 1 => 'mysql_affected_rows', ), 'next' => array ( 0 => 'function.mysql-close.php', 1 => 'mysql_close', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/mysql/functions/mysql-client-encoding.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 4 >= 4.3.0, PHP 5)
mysql_client_encoding — Returns the name of the character set
Esta extensão tornou-se defasada a partir do PHP 5.5.0 e foi removida no PHP 7.0.0. Em vez disso, as extensões MySQLi ou PDO_MySQL devem ser usadas. Veja também o guia MySQL: escolhendo uma API. Alternativas a esta função incluem:
Retrieves the character_set
variable from MySQL.
link_identifier
A conexão MySQL. Se o
identificador da conexão não for especificado, a última conexão aberta por
mysql_connect() será usada. Se não houver uma conexão anterior,
haverá uma tentativa de criar uma como se mysql_connect() tivesse sido chamada
sem argumentos. Se nenhuma conexão for encontrada ou estabelecida, um erro de nível
E_WARNING
será gerado.
Returns the default character set name for the current connection.
Exemplo #1 mysql_client_encoding() example
<?php
$link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
$charset = mysql_client_encoding($link);
echo "The current character set is: $charset\n";
?>
O exemplo acima produzirá algo semelhante a:
The current character set is: latin1