PHP | Spreadsheet_Excel_Writer | Introduction
Introduction: Spreadsheet_Excel_Writer is a library written in PHP which helps to read from and write to different types of spreadsheet file formats with the help of given set of classes.
Advantages:
- Easy and effective comparisons.
- Powerful analysis of large amounts of data.
- Splitting out large (or not so large) amounts of information in the form of a spreadsheet, which is easy to manipulate with a fairly ubiquitous spreadsheet program such as Excel (or OpenOffice).
Installation (Composer):
composer require pear/spreadsheet_excel_writer
Usage:
<?php
$workbook = new Spreadsheet_Excel_Writer();
$workbook ->send( 'gfg1.xls' );
$worksheet =& $workbook ->addWorksheet( '1st Worksheet' );
$worksheet ->write(0, 0, 'Website' );
$worksheet ->write(0, 1, 'Address' );
$worksheet ->write(1, 0, 'GeeksforGeeks' );
$workbook ->close();
?>
|
Output:
Reference: https://pear.php.net/manual/en/package.fileformats.spreadsheet-excel-writer.intro.php
Last Updated :
29 Nov, 2019
Like Article
Save Article
Share your thoughts in the comments
Please Login to comment...