ellumilel / php-excel-writer

MIT License
49 stars 12 forks source link

How write at a end of file without deleting #7

Open Asabbagh404 opened 4 years ago

Asabbagh404 commented 4 years ago

Hi,

I'm trying to write at the end of a file without deleting the last one . Is it possible ?

Thank you

ellumilel commented 4 years ago

Hi, What do you mean by deleting the last one ?

Asabbagh404 commented 4 years ago

Is it possible to add content to an existing file ? Because when I use the function "writeToFile", it crush my file with the same name :

`<?php require_once DIR . '/vendor/autoload.php';

$header = [ 'nom' => 'string', 'prenom' => 'string', 'telephone' => 'string', 'email' => 'string', ];

$wExcel = new Ellumilel\ExcelWriter(); $wExcel->writeSheetHeader('Sheet1', $header); $wExcel->setAuthor('Your name here'); $wExcel->writeSheetRow('Sheet1', [ $_POST['firstname'], $_POST['lastname'], $_POST['tel'], $_POST['mail'],

]);

$wExcel->writeToFile("example.xlsx"); header("location:". $_SERVER['HTTP_REFERER']); `