<?php $dbconn = pg_connect("host=localhost port=5432 dbname=mary") or die("Could not connect"); $v = pg_version($dbconn); echo $v['client'];?>
The above example will output:
7.4