PHP code example of tomk79 / csv2json
1. Go to this page and download the library: Download tomk79/csv2json 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/ */
tomk79 / csv2json example snippets
$csv2json = new \tomk79\csv2json( 'path/to/data.csv' );
var_dump( $csv2json->fetch_assoc() ); // 連想配列で受け取る
var_dump( $csv2json->to_json() ); // JSON形式の文字列で受け取る