mysql_client_encoding
(PHP 4 >= 4.3.0, PHP 5)
mysql_client_encoding -- Retorna o nome do conjunto de caracteres
Descrição
string
mysql_client_encoding ( [resource link_identifier] )
Obtém a variável character_set do MySQL.
Parâmetros
-
link_identifier
The MySQL connection. If the
link identifier is not specified, the last link opened by
mysql_connect() is assumed. If no such link is found, it
will try to create one as if mysql_connect() was called
with no arguments. If by chance no connection is found or established, an
E_WARNING level warning is generated.
Valores de retornado
Retorna o conjunto de caracteres padrão da conexão atual.
Exemplos
Exemplo 1. Exemplo mysql_client_encoding()
<?php $link = mysql_connect('localhost', 'mysql_user', 'mysql_password'); $charset = mysql_client_encoding($link);
echo "O conjunto de caracteres atual é: $charset\n"; ?>
|
O exemplo acima irá imprimir
algo similar a: O conjunto de caracteres atual é: latin1 |
|