PHP code example of gitfullstacker / laravel-csv-parser

1. Go to this page and download the library: Download gitfullstacker/laravel-csv-parser 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/ */

    

gitfullstacker / laravel-csv-parser example snippets


composer 

use GitFullStacker\CsvParser\Facades\CsvParser;

$csvData = CsvParser::parse(storage_path('data.csv'));

dd($csvData); // Returns Illuminate\Support\Collection of CSV rows

$csvData = CsvParser::parse(storage_path('semicolon-separated.csv'), ';');

try {
    $csvData = CsvParser::parse(storage_path('missing.csv'));
} catch (\Exception $e) {
    echo "Error: " . $e->getMessage();
}

'providers' => [
    GitFullStacker\CsvParser\CsvParserServiceProvider::class,
],
'aliases' => [
    'CsvParser' => GitFullStacker\CsvParser\Facades\CsvParser::class,
],

composer install
vendor/bin/phpunit