Currently I'm using the PHPSpreadsheet library to take values from PHP to Excel, what it does now is to take the values to an excel and store them in the address that I specify. but what I'm looking for is that when I upload information, show me the excel to open. When I used the PHPExcel if I could, and it was done with: $ objWriter-> save ('php: // output') then the excel was displayed to open. My code with PHPSpreadsheet is the following:
<?php
require_once("vendor/autoload.php");
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
$spreadsheet = new Spreadsheet();
$sheet = $spreadsheet->getActiveSheet();
$a="we";
$a1="are";
$a2="the";
$a3="world";
$sheet->setCellValue('A2', $a);
$sheet->setCellValue('c2', $a1);
$sheet->setCellValue('E2', $a2);
$sheet->setCellValue('G2', $a3);
$writer = new Xlsx($spreadsheet);
$writer->save('C:\xampp\ejemplo.xlsx');
?>
Could it be done?