php-excel-writer icon indicating copy to clipboard operation
php-excel-writer copied to clipboard

How write at a end of file without deleting

Open Asabbagh404 opened this issue 5 years ago • 2 comments

Hi,

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

Thank you

Asabbagh404 avatar May 29 '20 11:05 Asabbagh404

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

ellumilel avatar Jun 02 '20 09:06 ellumilel

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']); `

Asabbagh404 avatar Jun 24 '20 11:06 Asabbagh404