PHP code example of kenowlee / csv-convert

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

    

kenowlee / csv-convert example snippets




$results = Convert\CSV::toArray('/path-to-file/file.csv', ',');

//Results
array(2) { [0]=> string(14) "22637212000111" [1]=> string(6) "171665" }
array(2) { [0]=> string(14) "52079369000112" [1]=> string(6) "172837" }
array(2) { [0]=> string(14) "51055810000101" [1]=> string(6) "173288" }
array(2) { [0]=> string(14) "12404336000148" [1]=> string(6) "138230" }
array(2) { [0]=> string(14) "21675698000188" [1]=> string(6) "169931" }
array(2) { [0]=> string(14) "99349416000441" [1]=> string(6) "172536" }