PHP code example of ryoueno / csv

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

    

ryoueno / csv example snippets


    $src = new \Gojiro\Src('path/to/MyCSV.csv');

    $csv = new \Gojiro\Csv($src);

    $csv->get();
    /*
        [
            0 => [
                'id' => 1,
                'name' => 'UDON',
            ],
            1 => [
                'id' => 2,
                'name' => 'SHUSHI',
            ]
            .
            .
            .
        ]
    */


    $csv->select(['name'])->where->(['id' => 2])->get();
    /*
        [
            1 => [
                'name' => 'SHUSHI',
            ]
        ]
    */