2017 © Pedro Peláez
 

library php-json-array

Simple class that extends the capabilities of the basic php *array* by adding json casting and file handling (read and write).

image

amostajo/php-json-array

Simple class that extends the capabilities of the basic php *array* by adding json casting and file handling (read and write).

  • Saturday, December 5, 2015
  • by amostajo
  • Repository
  • 1 Watchers
  • 0 Stars
  • 82 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 3 Versions
  • 0 % Grown

The README.md

JSONArray (PHP class)

Latest Stable Version Total Downloads License, (*1)

Simple class that extends the capabilities of the basic php array by adding json casting and file handling (read and write)., (*2)

Quick start

  • Clone or download the latest release.
  • Via composer:
composer require amostajo/php-json-array

Usage

Creating an array:, (*3)

$array = new JSONArray();

Add items as you normally would do using arrays:, (*4)

$array[] = 'example';

$array['ID'] = 123;
$array['person'] = ['name' => 'John', 'lastname' => 'Doe'];

Casting:, (*5)

// To JSON
echo $array->toJson();

// To string (casts to JSON at the end)
echo (string)$array;

Write to file:, (*6)

// Writes array as json string into filename.
$array->write($filename);

Read from file:, (*7)

// Reads from filename.
$array->read($filename);

// Use loaded array
echo $array[$key];

Coding Guidelines

The coding is PSR-2., (*8)

License

JSONArray is free software distributed under the terms of the MIT license., (*9)

The Versions

05/12 2015

1.0.x-dev

1.0.9999999.9999999-dev https://github.com/amostajo/php-json-array

Simple class that extends the capabilities of the basic php *array* by adding json casting and file handling (read and write).

  Sources   Download

MIT

The Development Requires

php json array

05/12 2015

dev-master

9999999-dev https://github.com/amostajo/php-json-array

Simple class that extends the capabilities of the basic php *array* by adding json casting and file handling (read and write).

  Sources   Download

MIT

The Development Requires

php json array

05/12 2015

v1.0.0

1.0.0.0 https://github.com/amostajo/php-json-array

Simple class that extends the capabilities of the basic php *array* by adding json casting and file handling (read and write).

  Sources   Download

MIT

The Development Requires

php json array