PHP Conference Ehime 2026

pg_service

(PHP 8 >= 8.5.0)

pg_serviceGets the service name of the connection

Açıklama

function pg_service(?PgSql\Connection $connection = null): string

Returns the name of the connection service used to establish the connection, as defined in the connection service file.

This function is only available if PHP has been built against libpq 18 or later.

Bağımsız Değişkenler

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.

Uyarı

PHP 8.1.0 ve sonrasında, öntanımlı bağlantının kullanımı önerilmemektedir.

Dönen Değerler

A string containing the service name of the connection, or an empty string if no service was used.

Ayrıca Bakınız

  • pg_connect() - Open a PostgreSQL connection
  • pg_dbname() - Get the database name
  • pg_host() - Returns the host name associated with the connection
  • pg_port() - Return the port number associated with the connection
add a note

User Contributed Notes

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