Unfortunate that pg_fetch_all_columns() doesn't support fetching a column by its name -- if you want to do that, you'll need to use pg_field_num() as an intermediary:
For example:
<?php
if ($foo)
$cols = "email_address";
else
$cols = "last_name, middle_init";
$result = pg_query("Select first_name, $info, birthday from users_table");
$array = pg_fetch_all_columns($result, 2);
$array = pg_fetch_all_columns($result, 'birthday');
$array = pg_fetch_all_columns($result, pg_field_num($result, 'birthday'));
?>