I think you could write this more simply like

```php
while (list($email,$name,$phone,$phone_ext) = db_fetch_row($res)) {
    $record = array('email'=>$email, 'name'=>$name, 'info'=>"$email - $name");
    if ($cfg->getStorePhone())
        $record = array_merge($record, array(
            'phone' =>$phone,
            'phone_ext' =>$phone_ext,
        ));
}
```