PHP code example of 7interactive / php-office-helper

1. Go to this page and download the library: Download 7interactive/php-office-helper 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/ */

    

7interactive / php-office-helper example snippets


/**
 * Returns filename
 *
 * @param \DateTime $from
 * @param \DateTime $to
 * @return string
 */
public function createExcelSpreadsheetActivityLog(\DateTime $from, \DateTime $to): string
{
    /** @var ExampleSpreadsheet $document */
    $document = $this->documentFactory->createByClassName(ExampleSpreadsheet::class);
    $document->setRange($from, $to);
    return $this->documentFactory->save($document);
}