PHP code example of sergiors / importing

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

    

sergiors / importing example snippets


use Symfony\Component\Config\Loader\LoaderResolver;
use Symfony\Component\Config\Loader\DelegatingLoader;
use Symfony\Component\Config\FileLocator;

$loaders = [
    new Excel2007FileLoader(new FileLocator()),
    new Excel5FileLoader(new FileLocator()),
    new CsvFileLoader(new FileLocator())
];

$resolver = new LoaderResolver($loaders);
$loader = new DelegatingLoader($resolver);

$data = $loader->load('your_file.xls'); // return an array
// print_r($data);