PHP code example of technicalkumargaurav / file-reader

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

    

technicalkumargaurav / file-reader example snippets


echo $reader->toHtml(
    'sample.xlsx',
    [
        'toolbar' => true
    ]
);

echo $reader->toHtml(
    'sample.xlsx',
    [
        'toolbar'   => true,
        'csv_url'   => '/export/csv',
        'excel_url' => '/export/excel'
    ]
);

echo $reader->toHtml(
    'sample.xlsx',
    [
        'toolbar' => true,
        'print'   => true
    ]
);

echo $reader->toHtml(
    'sample.xlsx',
    [
        'toolbar'   => true,
        'csv_url'   => '/export/csv',
        'excel_url' => '/export/excel',
        'new_tab'   => true
    ]
);

echo $reader->toHtml(
    'sample.xlsx',
    [
        'toolbar'    => true,
        'csv_url'    => '/export/csv',
        'excel_url'  => '/export/excel',

        'show_csv'   => true,
        'show_excel' => false,
        'show_print' => true
    ]
);
text
src/
├── Drivers/
│   ├── CsvReader.php
│   ├── ExcelReader.php
│   └── PdfReader.php
│
├── Exporters/
│   ├── CsvExporter.php
│   └── ExcelExporter.php
│
├── Exceptions/
│   └── UnsupportedFileException.php
│
├── Helpers/
│   ├── ResponseFormatter.php
│   ├── PreviewGenerator.php
│   ├── HtmlGenerator.php
│   └── ToolbarGenerator.php
│
└── Reader.php