Warning: file_put_contents(): Only -1 of 59 bytes written, possibly out of free disk space in /var/www/html/index.php on line 3

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/index.php:3) in /var/www/html/cache.php on line 23

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/index.php:3) in /var/www/html/cache.php on line 24

Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/index.php:3) in /var/www/html/cache.php on line 25
pg_cancel_query pg_close PostgreSQL PHP Manual pg_client_encoding (PHP 4 >= 4.0.3, 5) — Gets the client encoding Description string ([ resource $connection ] ) supports automatic character set...
Forum und email

pg_client_encoding

(PHP 4 >= 4.0.3, PHP 5)

pg_client_encoding — Gets the client encoding

Description

string pg_client_encoding ([ resource $connection ] )

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.

Note: This function requires PHP 4.0.3 or higher and 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().

Parameters

connection

PostgreSQL database connection resource. When connection is not present, the default connection is used. The default connection is the last connection made by pg_connect() or pg_pconnect().

Return Values

The client encoding, or FALSE on error.

Exempel

Example#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";
?>

The above example will output:

Client encoding is: ISO-8859-1