private function Excel_XML::addRow in Ubercart CSV 6.2
Same name and namespace in other branches
- 7.2 inc/excel-export.inc \Excel_XML::addRow()
Add row
Adds a single row to the document. If set to true, self::bConvertTypes checks the type of variable and returns the specific field settings for the cell.
Parameters
array $array One-dimensional array with row content:
1 call to Excel_XML::addRow()
- Excel_XML::addArray in inc/excel-export.inc 
- Add an array to the document
File
- inc/excel-export.inc, line 124 
Class
- Excel_XML
- Generating excel documents on-the-fly from PHP5
Code
private function addRow($array) {
  $cells = "";
  foreach ($array as $k => $v) {
    $type = 'String';
    if ($this->bConvertTypes === true && is_numeric($v)) {
      $type = 'Number';
    }
    $v = htmlentities($v, ENT_COMPAT, $this->sEncoding);
    $cells .= "<Cell><Data ss:Type=\"{$type}\">" . $v . "</Data></Cell>\n";
  }
  $this->lines[] = "<Row>\n" . $cells . "</Row>\n";
}