PHP code example of foxmarketingdigital / excel-reader

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

    

foxmarketingdigital / excel-reader example snippets

bash


    use Foxmarketingdigital\ExcelReader\ExcelReader;

    celReader = new ExcelReader();
    /** @var string $file */
    $file = __DIR__ . '/teste.xlsx';

    /** Carrega o arquivo xls/xlsx */
    /** load file xls/xlsx */
    $ExcelReader->loadFile($file);

    /** ler linhas do arquivo retornando um array não associativo */
    /** read lines from file returning non-associative array */
    var_dump($ExcelReader->getRows());
    echo "<hr><hr>";
    /** ler linhas do arquivo retornando um array  associativo */
    /** read lines from file returning associative array */
    var_dump($ExcelReader->getRowsAssoc());

bash


    use Foxmarketingdigital\ExcelReader\ExcelReader;

    celReader = new ExcelReader();
    /** @var string $file */
    $file = __DIR__ . '/teste.xlsx';

    /** Carrega o arquivo xls/xlsx */
    /** load file xls/xlsx */
    $ExcelReader->loadFile($file);

    echo $ExcelReader->inHTML();