/php_fast_xlsxwriter

a php extension to write an array to excel(.xlsx file) fast/快速导出PHP Excel xlsx文件

Primary LanguageCOtherNOASSERTION

php_fast_xlsxwriter

a php extension to write an array to excel(.xlsx file) fast

一个快速导出Excel(.xlsx)文件的PHP扩展

Requirements

Installation

git clone https://github.com/friparia/php_fast_xlsxwriter
cd php_fast_xlsxwriter
phpize
./configure --with-xlsxwriter --with-libxlsxwriter=/path/to/libxlsxwriter
make && make install

Then, add extension=xlsxwriter.so in your php.ini file

Usage

xlsx_write

$a = ['a', 'b'];
$path = '~/test.xlsx';
xlsx_write($a, $path);
$b = [
    ['a', 'b'], ['a1', 'b1']
];
xlsx_write($b, $path);

xlsx_write_by_sheet

$c = [
    'sheet1' => [
        ['a', 'b'], ['a1', 'b1']
    ],
];
xlsx_write_by_sheet($b, $path);