hi all, i want to ask how to export excel but i want it extension is .xlxs not xls?
i edit the code in phpexcel extension php-excel.class.php
public function generateXML ($filename = 'excel-export', $correctFilename=true)
{
// correct/validate filename
if($correctFilename)
$filename = preg_replace('/[^aA-zZ0-9\_\-]/', '', $filename);
// deliver header (as recommended in php manual)
header("Content-Type: application/vnd.ms-excel; charset=" . $this->sEncoding);
[u] header("Content-Disposition: inline; filename=\"" . $filename . ".xls\"");
[/u]
// print out document to the browser
// need to use stripslashes for the damn ">"
echo stripslashes (sprintf($this->header, $this->sEncoding));
echo "\n<Worksheet ss:Name=\"" . $this->sWorksheetTitle . "\">\n<Table>\n";
foreach ($this->lines as $line)
echo $line;
echo "</Table>\n</Worksheet>\n";
echo $this->footer;
}
i change the this code
header("Content-Disposition: inline; filename=\"" . $filename . "[u].xls[/u]\"");
into this code:
header("Content-Disposition: inline; filename=\"" . $filename . "[u].xlsx[/u]\"");
its working not show any error, but when i download or open the file the extension is .xlsx.xls
thanks