I need to write a .xls file with data from a mysql database. Everything is fine, except when there is a field with this line: "FALSE N | NOT USE".
In this case, in a particular cell, it writes only "FALSE N" and stops there without writing "|" and everything that comes after.
These problems also occur with other characters, such as "Ï"
This is a piece of code that writes a file.
while (!$rs->EOF){
$objPHPExcel->setActiveSheetIndex(0)
->setCellValueExplicit('A'.$i, $rs->fields["nr_id"], PHPExcel_Cell_DataType::TYPE_STRING2)
->setCellValue('B'.$i, $rs->fields["descrizione"])
->setCellValue('C'.$i, number_format($rs->fields["prezzo_eur"], 2, ",", ""));
$rs->Movenext();
$i++;
}
Is there a way to write everything?
It is not related to html objects!
UPDATE: I just encoded in utf8 and everything is fine, thanks everyone!
source
share