PHP Conference Ehime 2026

pg_service

(PHP 8 >= 8.5.0)

pg_serviceGets the service name of the connection

Descripción

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.

Parámetros

connection

Una instancia PgSql\Connection. Cuando connection es null, se usa la conexión predeterminada. La conexión predeterminada es la última conexión hecha por pg_connect() o pg_pconnect()

Advertencia

Desde PHP 8.1.0, usar la conexión predeterminada está obsoleto.

Valores devueltos

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

Véase también

add a note

User Contributed Notes

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