Here they speak about what you are looking for : http://www.php.net/manual/en/function.pg-prepare.php#62675
$result = pg_prepare($dbconn, "my_query", 'SELECT id FROM people WHERE name IN($1,$2,$3)');
$result = pg_execute($dbconn, "my_query", array("foo", "bar", "test"));