PHP code example of fml / phpsimpleexcel

1. Go to this page and download the library: Download fml/phpsimpleexcel 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/ */

    

fml / phpsimpleexcel example snippets




l = new FML\PhpSimpleExcel\PhpSimpleExcel();
$excel->addNamedStyle('idFormat', array(
        "NumberFormat" => array(
            "ss:Format" => "##00"
        )
    ));
$excel->addRow(array(
        "id", "Column1", "Column2"
    ));

foreach(range(0,11) as $id) {
    $excel
        ->startRow()
        ->addCell($id, 'Number', 'idFormat')
        ->addCell('value'.$id)
        ->addCell('value2'.$id)
        ->end();
}
echo $excel->generateXML('excel');