PHP code example of natilosir / excel

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

    

natilosir / excel example snippets


use Natilosir\Excel\Excel;

$data = [
    ["Name", "Age", "Salary"],
    ["John Doe", 28, 5000],
    ["Jane Smith", 34, 7000],
    ["Mark Taylor", 45, 9000],
];
Excel::ToExcel($data, "example.xlsx");

    $arrayFromExcel = Excel::ToArray("example.xlsx");
    print_r($arrayFromExcel);