1. Go to this page and download the library: Download diamond-dove/simple-json 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/ */
diamond-dove / simple-json example snippets
use DiamondDove\SimpleJson\SimpleJsonReader;
SimpleJsonReader::create('users.json')->get()
->each(function(array $user) {
// process the row
});
use DiamondDove\SimpleJson\SimpleJsonReader;
// $records is an instance of Illuminate\Support\LazyCollection
$records = SimpleJsonReader::create($pathToJson)->get();
$records->each(function(array $user) {
// in the first pass $user will contain
// ['email' => '[email protected]', 'first_name' => 'john']
});