Code: Select all
public function toXL(){
$this->GetMatches();
echo $this->_totalmatchingrows. "Lines found<br>";
$filename = "registraire_" . date('Ymd_HMS') . ".csv";
$out = fopen("php://output", 'w');
$this->MoveFirst();
header("Content-Disposition: attachment; filename=\"$filename\"");
header("Content-Type: text/csv; charset=UTF-8");
while(!$this->EOF()){
$row = $this->fields;
$retval = fputcsv($out, array_values($row), ',', '"');
//echo "<br>Wrote ". $retval.'<br>';
$this->MoveNext();
}
fclose($out);
}