array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'tr', ), 'this' => array ( 0 => 'function.pg-client-encoding.php', 1 => 'pg_client_encoding', ), 'up' => array ( 0 => 'ref.pgsql.php', 1 => 'PostgreSQL İşlevleri', ), 'prev' => array ( 0 => 'function.pg-cancel-query.php', 1 => 'pg_cancel_query', ), 'next' => array ( 0 => 'function.pg-close.php', 1 => 'pg_close', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/pgsql/functions/pg-client-encoding.xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 4 >= 4.0.3, PHP 5, PHP 7, PHP 8)
pg_client_encoding — Gets the client encoding
PostgreSQL supports automatic character set conversion between server and client for certain character sets. pg_client_encoding() returns the client encoding as a string. The returned string will be one of the standard PostgreSQL encoding identifiers.
Bilginize:
This function requires PostgreSQL 7.0 or higher. If libpq is compiled without multibyte encoding support, pg_client_encoding() always returns
SQL_ASCII
. Supported encoding depends on PostgreSQL version. Refer to the PostgreSQL Documentation supported encodings.The function used to be called pg_clientencoding().
connection
PgSql\Connection
nesnesi. bağlantı
null
ise, öntanımlı bağlantı
kullanılır.Öntanımlı bağlantı pg_connect()
veya pg_pconnect() işleviyle kurulmuş son bağlantıdır.
PHP 8.1.0 ve sonrasında, öntanımlı bağlantının kullanımı önerilmemektedir.
The client encoding.
Sürüm: | Açıklama |
---|---|
8.1.0 |
bağlantı bağımsız değişkeni artık
PgSql\Connection nesnesi kabul ediyor, evvelce bir
özkaynak kabul ederdi.
|
8.0.0 |
connection is now nullable.
|
Örnek 1 pg_client_encoding() example
<?php
// Assume $conn is a connection to a ISO-8859-1 database
$encoding = pg_client_encoding($conn);
echo "Client encoding is: ", $encoding, "\n";
?>
Yukarıdaki örneğin çıktısı:
Client encoding is: ISO-8859-1