alsalty/jsonfile

PHP library to deal with json files

v1.0.3 2022-12-06 08:48 UTC

This package is auto-updated.

Last update: 2025-04-06 14:05:37 UTC


README

📄
JsonFile

PHP library to deal with json files

☕ Feel free to contribute !!

Simple usage

composer require alsalty/jsonfile
<?php

require 'vendor/autoload.php';

use Alsalty\Jsonfile\File;
use Alsalty\Jsonfile\Convert;
$data = ['name' => 'mohamad'];


// convert array to json
$data = Convert::convertToJson($data);


//initiate
$file = new File('data', 'test.json');

//create the file
$file->create($data);

//read the file
echo($file->read());

//delete the file
$file->delete();