php postgres connection string using high availability cluster with multiple nodes

I have setup a Postgresql HA Cluster using pg_auto_failover. I need to connect the application only to the primary node. According to an article I read on the internet, it seems is possible using the target_session_attrs=read-write parameter.

So I've tried the following:

$conn = pg_connect("host=172.18.75.99,172.18.75.100 port=5432 dbname=test user=postgres password= target_session_attrs=read-write") or die("Could not connect");
$status = pg_connection_status($conn);
if ($status === PGSQL_CONNECTION_OK) {
    print "Connection status ok\n";
}
else {
    print "Connection status bad\n";
}

However, the response is:

Warning: pg_connect(): Unable to connect to PostgreSQL server: could not translate host name "172.18.75.99,172.18.75.100" to address: Unknown host in C:\xampp\htdocs\test\index.php on line 38
Could not connect

If I'm trying a connection with only one node, it works:

$conn = pg_connect("host=172.18.75.99 port=5432 dbname=test user=postgres password= target_session_attrs=read-write") or die("Could not connect");
$status = pg_connection_status($conn);
if ($status === PGSQL_CONNECTION_OK) {
    print "Connection status ok\n";
}
else {
    print "Connection status bad\n";
}

This returns:

Connection status ok

Not sure how to make it work, using both of the nodes in the connection string.