1. Go to this page and download the library: Download yakub/yxel library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
$write = \Yakub\Yxel\Main::write('yxel_test', \Yakub\Yxel\Main::XLSX);
$write->addRow(['A1', 'B1', '']);
$write->addRow(['A2', '', 'C2']);
$write->close();
// Return full path to file
$patToFile = $write->getFilePath();
$write = \Yakub\Yxel\Main::write('yxel_test', \Yakub\Yxel\Main::CSV);
$write->addRow(['A1', 'B1', '']);
$write->addRow(['A2', '', 'C2']);
// Instead of close use save. This function only save new data but file is still able to get new rows. Also this help clean memory.
// After save script can end and data will not be lost
$write->save();
// Name of file must be same
$write = \Yakub\Yxel\Main::write('yxel_test', \Yakub\Yxel\Main::CSV);
// Add new row to previous in this file
$write->addRow(['', 'B3', 'C3']);
// After close can't open this file again. If is used same name then file will be rewrited with new data
$write->close();