Statement on glibc/iconv Vulnerability

mysql_client_encoding

(PHP 4 >= 4.3.0, PHP 5)

mysql_client_encodingReturns the name of the character set

Aviso

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:

Descrição

mysql_client_encoding(resource $link_identifier = NULL): string

Retrieves the character_set variable from MySQL.

Parâmetros

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.

Valor Retornado

Returns the default character set name for the current connection.

Exemplos

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

Veja Também

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top