pg_service
PHP function
Edit on GitHub ✎
(PHP 8 >= 8.5.0)
Gets the service name of the connection
Description
pg_service(PgSql\Connection|null $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.
Parameters
connectionConnection-with-nullable-default
Return Values
A string containing the service name of the connection, or an empty string if no service was used.