You are here

function ViewsDataExportExporterTXT::add_row in Views data export 7.4

Add a single row to the export file.

Parameters

$file_handle: A PHP file handle to the export file.

array $data: An array of formatted data for this row. One cell per item.

int $row_count: The current number of rows in the export file.

$field_titles:

Overrides ViewsDataExportExporter::add_row

File

exporters/views_data_export_exporter_txt.inc, line 35

Class

ViewsDataExportExporterTXT
Exporter for creating TXT files.

Code

function add_row(&$file_handle, $data, $row_count, $field_titles) {
  $row = '';
  foreach ($data as $key => $value) {
    $row .= '[' . $field_titles[$key] . ']' . PHP_EOL . PHP_EOL;
    $row .= $value . PHP_EOL;
  }
  $row .= '----------------------------------------' . PHP_EOL . PHP_EOL;
  fwrite($file_handle, $row);
}