1. Go to this page and download the library: Download pearl/csv-json-converter 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/ */
<!-- Convert and save the result to specificed path -->
$jsonToCsv->convertAndSave(__Dir__ . '/output');
<!-- Convert and force download the file in browser-->
$jsonToCsv->convertAndDownload(__Dir__ . '/output');
<!-- Convert and get data-->
$jsonToCsv->convert();
use Pearl\CsvJsonConverter\Type\CsvToJson;
$csvToJson = new CsvToJson($csvString, ['bitmask' => 'JSON_PRETTY_PRINT|JSON_UNESCAPED_UNICODE|JSON_UNESCAPED_SLASHES']);
$csvToJson->load(__Dir__ . '/data/products.csv');
<!-- Convert and save to specificed path -->
$csvToJson->convertAndSave(__Dir__ . '/output');
<!-- Convert and force download the file-->
$csvToJson->convertAndDownload(__Dir__ . '/output');
<!-- Convert and get data-->
$csvToJson->convert();
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.